/*
LV-RP v0.085

Credits
iLLNeSS (**)
Shony (**)

Changelog
0.01 - Added registration system using DINI.
0.02 - Added simple administrative (/a, /setadmin, /kick, /ban) commands.
0.03 - Several bugfixes, and local chat added.
0.04 - Added /enter and /exit CMDs, added Clothes Store (/buyclothes).
0.041 - Several bugfixes, and bank system.
0.045 - Added Last Position system.
0.05 - Added /shout, /low, /me, and /do.
0.055 - Added /w, /stats.
0.057 - Optimized all commands.
0.06 - Added admin jail system (/jail, /release).
0.061 - Bugfixes, and mute system.
0.065 - Death system added.
0.067 - Added /suicide. Added license system (/getlicence, /licenses) with arms license. Added CityHall and Ammunation. Several bugfixes.
0.07 - Added weapon system (/buyweapon, /giveweapon, /dropweapon). Change CityHall exterior and map icon, added Well Stacked Pizza.
0.075 - Added Pizza Boy Job. Added driver license and /showlicenses. Bugfixes.
0.077 - Bugfixes, and revamp of jail system.
0.078 - Added global help chat and report system. (/help, /toghelp)(Admin CMD /toghelpchat)(/report, /acceptr, /trashr)
0.085 - Added vehicle system.
*/

// Includes
#include <a_samp>
#include <dini>
#include <dudb>
#include <zcmd>
#include <sscanf2>
#include <streamer>
#include <a_zones>
#pragma unused ret_memcpy

// Defines
#define registerdialog 0
#define logindialog 1
#define gversion 0.085

// Colors
#define color_red 0xFF0000AA
#define color_green 0x00D900AA
#define color_lightblue 0x01F5F8AA
#define color_blue 0x0000FFAA
#define color_gray 0xAAAAAAAA
#define color_white 0xFFFFFFAA
#define color_yellow 0xFFFF00AA
#define color_orange 0xFF6347AA
#define color_usertext 0xE0E0E0AA
#define color_purple 0xC2A2DAAA

// Player Info
enum pInfo
{
	Level,
    AdminLevel,
	Money,
	Bank,
	Skin,
	Float:pX,
	Float:pY,
	Float:pZ,
	Float:pA,
	pI,
	Jailed,
	jTime,
	Muted,
	Dead,
	ArmsLicense,
	Weapon,
	Ammo,
	Job,
	Duty,
	PizzaDeliveries,
	DriverLicense,
	Delivered,
	helpTime,
	hChatOff,
	reportTime,
	reported,
	carModel,
	Float:carX,
	Float:carY,
	Float:carZ,
	Float:carA,
	carColor1,
	carColor2,
	carID,
	carMod[14],
	carPaintJob,
	carLicensePlate,
	carLocked,
	carDeal,
	carDealPrice,
	carTracking,
	Faction,
	LoggedIn
}

new PlayerInfo[MAX_PLAYERS][pInfo];

new Float:randomCell[][4] =
{
	{193.80, 174.95, 1003.00, 0.00},
	{198.05, 175.15, 1003.00, 0.00},
	{198.10, 162.05, 1003.00, 180.00}
};

new Float:randomBed[][11] =
{
	{1939.6975, -2121.9578, -18.6666, 180.00},
	{1939.6459, -2118.6812, -18.6666, 180.00},
	{1939.6130, -2115.1650, -18.6666, 180.00},
	{1926.1772, -2108.0237, -18.2554, 180.00},
	{1920.3086, -2108.1641, -18.2554, 180.00},
	{1920.2622, -2105.6313, -18.2554, 0.00},
	{1926.3318, -2105.6987, -18.2554, 0.00},
	{1944.5656, -2115.3843, -18.6706, 90.00},
	{1944.6017, -2119.2036, -18.6706, 90.00},
	{1944.6379, -2122.9170, -18.6706, 90.00}
};

new Float:randomPizza[][18] =
{
    {1223.0153, 2616.7769, 10.8265},
	{1349.6202, 2567.6873, 10.8203},
	{1608.5872, 2754.1406, 10.8203},
	{1556.0516, 2658.5159, 10.8203},
	{1637.8011, 2801.4797, 10.8203},
	{1921.7714, 2665.1953, 10.8203},
	{1032.5448, 2316.6458, 11.4683},
	{1029.3638, 1905.8857, 11.4609},
	{1464.4985, 1920.0424, 11.4609},
	{1595.4987, 2123.2185, 11.4609},
	{1684.5065, 2123.3577, 11.4609},
	{2794.2202, 2221.9246, 10.8203},
	{2788.0586, 2268.4951, 10.8203},
	{2579.0833, 719.4871, 10.8203},
	{2666.4951, 742.5487, 10.8203},
	{2317.8965, 656.1030, 11.4531},
	{2450.2747, 742.6340, 11.4609},
	{2177.2388, 690.3503, 11.4609}
};

new VehicleNames[212][] = {
	"Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", 
	"Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus", "Voodoo", 
	"Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", 
	"Washington", "Bobcat", "Mr. Whoopee", "BF. Injection", "Hunter", "Premier", "Enforcer", 
	"Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", "Article Trailer", 
	"Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", 
	"Admiral", "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Article Trailer 2", "Turismo", "Speeder", 
	"Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van", "Skimmer", 
	"PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic", "Sanchez", 
	"Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", 
	"Walton", "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage", "Dozer", 
	"Maverick", "News Chopper", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", 
	"Sandking", "Blista Compact", "Police Maverick", "Boxville", "Benson", "Mesa", "RC Goblin", 
	"Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT", "Elegant", 
	"Journey", "Bike", "Mountain Bike", "Beagle", "Cropdust", "Stunt", "Tanker", "Roadtrain", 
	"Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", 
	"Cement Truck", "Tow Truck", "Fortune", "Cadrona", "FBI Truck", "Willard", "Forklift", 
	"Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak", 
	"Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck LA", "Hustler", "Intruder", 
	"Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite", "Windsor", 
	"Monster A", "Monster B", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", 
	"RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat", "Streak Carriage", 
	"Kart", "Mower", "Dunerider", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", 
	"Stafford", "BF-400", "Newsvan", "Tug", "Article Trailer 3", "Emperor", "Wayfarer", "Euros", "Mobile Hotdog", 
	"Club", "Freight Carriage", "Trailer 3", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car (LSPD)", 
	"Police Car (SFPD)", "Police Car (LVPD)", "Police Ranger", "Picador", "S.W.A.T Van", "Alpha", 
	"Phoenix", "Glendale", "Sadler", "Luggage Trailer A", "Luggage Trailer B", "Stair Trailer", 
	"Boxville", "Farm Plow", "Utility Trailer"
};

new cellGates[12][2];

new hospitalTimer[MAX_PLAYERS];
new jailTimer[MAX_PLAYERS];
new helpTimer[MAX_PLAYERS];
new reportTimer[MAX_PLAYERS];
new helpChatOff = 0;

forward serveJail(playerid);
forward hospitalHeal(playerid);
forward unfreezePlayer(playerid);
forward helpChat(playerid);
forward report(playerid);

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" LV:RP - Las Venturas Roleplay "#gversion"\n\n");
	print(" Created by:\n");
	print(" - iLLNeSS (**)\n");
	print(" - Shony (**)\n");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n--------------------------------------");
	print(" LV:RP - Las Venturas Roleplay "#gversion"\n\n");
	print(" Created by:\n");
	print(" - iLLNeSS (**)\n");
	print(" - Shony (**)\n");
	print("--------------------------------------\n");
}

#endif

// User-made functions
stock NearByMessage(playerid, colour, string[], Float:radius){
	new Float: PlayerX, Float: PlayerY, Float: PlayerZ;
	for(new i = 0; i < MAX_PLAYERS; i++){
		if(IsPlayerConnected(i)){
			GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ);
			if(IsPlayerInRangeOfPoint(i, radius, PlayerX, PlayerY, PlayerZ)){
				if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i) && GetPlayerInterior(playerid) == GetPlayerInterior(i)){
					SendClientMessage(i, colour, string);
				}
			}
		}
	}
	return 1;
}

stock IsValidSkin(SkinID){
	if((SkinID >= 0 && SkinID <= 2)||(SkinID == 7)||(SkinID >= 9 && SkinID <= 41)||(SkinID >= 43 && SkinID <= 64)||(SkinID >= 66 && SkinID <= 73)||(SkinID >= 75 && SkinID <= 85)||(SkinID >= 87 && SkinID <= 118)||(SkinID >= 120 && SkinID <= 148)||(SkinID >= 150 && SkinID <= 207)||(SkinID >= 209 && SkinID <= 264)||(SkinID >= 274 && SkinID <= 288)||(SkinID >= 290 && SkinID <= 299)) return true;
	else return false;
}

stock GivePlayerMoneyEx(playerid, money){
	PlayerInfo[playerid][Money] += money;
}

stock GivePlayerWeaponEx(playerid, weapon, ammo){
	PlayerInfo[playerid][Weapon] = weapon;
	PlayerInfo[playerid][Ammo] += ammo;
}

stock RemoveUnderscore(playerid){
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,sizeof(pName));
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(pName[i] == '_') pName[i] = ' ';
    }
    return pName;
}

stock IsPlayerInRangeOfPlayer(playerid, targetid, Float:radius){
	if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
	{
		new Float:posX, Float:posY, Float:posZ;
		GetPlayerPos(playerid, posX, posY, posZ);
		if(IsPlayerInRangeOfPoint(targetid,radius,posX,posY,posZ))
		{
		    return 1;
  		}
	}
	return 0;
}

stock IsPlayerInRangeOfVehicle(playerid, vehicleid, Float:radius) {
	new Float:vehicleX, Float:vehicleY, Float:vehicleZ;
	GetVehiclePos(vehicleid, vehicleX, vehicleY, vehicleZ);
	if(IsPlayerInRangeOfPoint(playerid, radius, vehicleX, vehicleY, vehicleZ)){
		return 1;
	}
	return 0;
}

public serveJail(playerid){
	if(PlayerInfo[playerid][jTime] != 0){
		PlayerInfo[playerid][jTime] = PlayerInfo[playerid][jTime] - 1000;
		jailTimer[playerid] = SetTimerEx("serveJail", 1000, false, "i", playerid);
	} else {
		SetPlayerInterior(playerid, 0);
		SetPlayerPos(playerid, 1680, 1447.75 ,10.77);
		SetPlayerFacingAngle(playerid, 270);
		GameTextForPlayer(playerid, "You are free, please follow the rules next time", 3000, 4);
		PlayerInfo[playerid][Jailed] = 0;
		PlayerInfo[playerid][jTime] = 0;
		KillTimer(jailTimer[playerid]);
	}
	return 1;
}

stock jailPlayer(playerid){
	new rndCell = random(sizeof(randomCell));
	PlayerInfo[playerid][Weapon] = 0;
	PlayerInfo[playerid][Ammo] = 0;
	SetPlayerInterior(playerid, 3);
	SetPlayerPos(playerid, randomCell[rndCell][0], randomCell[rndCell][1], randomCell[rndCell][2]);
	SetPlayerFacingAngle(playerid, randomCell[rndCell][3]);
	jailTimer[playerid] = SetTimerEx("serveJail", 1000, false, "i", playerid);
	return 1;
}

stock releasePlayer(playerid){
	PlayerInfo[playerid][Jailed] = 0;
	PlayerInfo[playerid][jTime] = 0;
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid, 1680, 1447.75 ,10.77);
	SetPlayerFacingAngle(playerid, 270);
	GameTextForPlayer(playerid, "You are free, please follow the rules next time", 3000, 4);
	KillTimer(jailTimer[playerid]);
	return 1;
}

public hospitalHeal(playerid){
 	new Float:health;
	GetPlayerHealth(playerid, health);
	if(health < 50){
		SetPlayerHealth(playerid, health + 2);
		hospitalTimer[playerid] = SetTimerEx("hospitalHeal", 1000, false, "i", playerid);
	} else {
		TogglePlayerControllable(playerid, 1);
		ClearAnimations(playerid);
		PlayerInfo[playerid][Dead] = 0;
		SendClientMessage(playerid, color_white, "You have been healed by medical staff!");
		GivePlayerMoneyEx(playerid, -100);
		KillTimer(hospitalTimer[playerid]);
	}
	return 1;
}

stock healPlayer(playerid){
	new rndBed = random(sizeof(randomBed));
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid, randomBed[rndBed][0], randomBed[rndBed][1], randomBed[rndBed][2]);
	SetPlayerFacingAngle(playerid, randomBed[rndBed][3]);
	TogglePlayerControllable(playerid, 0);
	ApplyAnimation(playerid, "CRACK", "crckidle2", 4.0, 1, 0, 0, 0, 0, 1);
	hospitalTimer[playerid] = SetTimerEx("hospitalHeal", 1000, false, "i", playerid);
	return 1;
}

public unfreezePlayer(playerid){
	TogglePlayerControllable(playerid, 1);
	return 1;
}

public helpChat(playerid){
	if(PlayerInfo[playerid][helpTime] != 0){
	    PlayerInfo[playerid][helpTime]--;
	    helpTimer[playerid] = SetTimer("helpChat", 1000, false);
	} else {
	    KillTimer(helpTimer[playerid]);
	}
	return 1;
}

public report(playerid){
	if(PlayerInfo[playerid][reportTime] != 0 && PlayerInfo[playerid][reported] == 1){
	    PlayerInfo[playerid][reportTime]--;
	    reportTimer[playerid] = SetTimer("report", 1000, false);
	} else {
 		PlayerInfo[playerid][reported] = 0;
	    KillTimer(reportTimer[playerid]);
	}
	return 1;
}

stock BuyDealershipVehicle(playerid, price, modelid){
	if(PlayerInfo[playerid][Money] < price){
		return SendClientMessage(playerid, color_gray, "You don't have enough money to buy this vehicle!");
	} else if(PlayerInfo[playerid][carModel] != 0){
		return SendClientMessage(playerid, color_gray, "You already own a vehicle!");
	} else {
		new string[64];
		PlayerInfo[playerid][carModel] = modelid;
		PlayerInfo[playerid][carX] = 2162.39;
		PlayerInfo[playerid][carY] = 1392.19;
		PlayerInfo[playerid][carZ] = 10.62;
		PlayerInfo[playerid][carA] = 90.0;
		PlayerInfo[playerid][carColor1] = random(126);
		PlayerInfo[playerid][carColor2] = random(126);
		for(new i = 0; i < 13; i++){
			PlayerInfo[playerid][carMod][i] = 0;
		}
		PlayerInfo[playerid][carPaintJob] = 0;
		PlayerInfo[playerid][carLicensePlate] = 1000 + random(8999);
		PlayerInfo[playerid][Money] -= price;
		CreatePlayerVehicle(playerid);
		format(string, sizeof(string), "Congratulations! You have purchased a %s for $%i.", VehicleNames[modelid - 400], price);
		SendClientMessage(playerid, color_white, string);
	}
	return 1;
}

stock CreatePlayerVehicle(playerid){
	new licensePlate[32];
	if(PlayerInfo[playerid][carModel] != 0){
		PlayerInfo[playerid][carID] = CreateVehicle(PlayerInfo[playerid][carModel], PlayerInfo[playerid][carX], PlayerInfo[playerid][carY], PlayerInfo[playerid][carZ], PlayerInfo[playerid][carA], PlayerInfo[playerid][carColor1], PlayerInfo[playerid][carColor2], -1);
		for(new i = 0; i < 13; i++){
			if(PlayerInfo[playerid][carMod][i] != 0){
				AddVehicleComponent(PlayerInfo[playerid][carID], PlayerInfo[playerid][carMod][i]);
			}
		}
		format(licensePlate, sizeof(licensePlate), "{FF0000}LV{FFFFFF}-%i", PlayerInfo[playerid][carLicensePlate]);
		ChangeVehiclePaintjob(PlayerInfo[playerid][carID], PlayerInfo[playerid][carPaintJob]);
		SetVehicleNumberPlate(PlayerInfo[playerid][carID], licensePlate);
	}
	return 1;
}

stock SavePlayer(playerid){
    new file[255], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(file, sizeof(file), "/players/%s.ini", pName);
    if(PlayerInfo[playerid][LoggedIn] == 1){
    dini_IntSet(file, "Level", PlayerInfo[playerid][Level]);
    dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
    dini_IntSet(file, "Money", PlayerInfo[playerid][Money]);
	dini_FloatSet(file, "pX", PlayerInfo[playerid][pX]);
	dini_FloatSet(file, "pY", PlayerInfo[playerid][pY]);
	dini_FloatSet(file, "pZ", PlayerInfo[playerid][pZ]);
	dini_FloatSet(file, "pA", PlayerInfo[playerid][pA]);
	dini_IntSet(file, "pI", PlayerInfo[playerid][pI]);
	dini_IntSet(file, "Bank", PlayerInfo[playerid][Bank]);
	dini_IntSet(file, "Skin", PlayerInfo[playerid][Skin]);
	dini_IntSet(file, "Jailed", PlayerInfo[playerid][Jailed]);
	dini_IntSet(file, "jTime", PlayerInfo[playerid][jTime]);
	dini_IntSet(file, "Muted", PlayerInfo[playerid][Muted]);
	dini_IntSet(file, "Dead", PlayerInfo[playerid][Dead]);
	dini_IntSet(file, "ArmsLicense", PlayerInfo[playerid][ArmsLicense]);
	dini_IntSet(file, "Weapon", PlayerInfo[playerid][Weapon]);
	dini_IntSet(file, "Ammo", PlayerInfo[playerid][Ammo]);
    dini_IntSet(file, "Job", PlayerInfo[playerid][Job]);
   	dini_IntSet(file, "Duty", PlayerInfo[playerid][Duty]);
    dini_IntSet(file, "PizzaDeliveries", PlayerInfo[playerid][PizzaDeliveries]);
    dini_IntSet(file, "DriverLicense", PlayerInfo[playerid][DriverLicense]);
	dini_IntSet(file, "carModel", PlayerInfo[playerid][carModel]);
	dini_FloatSet(file, "carX", PlayerInfo[playerid][carX]);
	dini_FloatSet(file, "carY", PlayerInfo[playerid][carY]);
	dini_FloatSet(file, "carZ", PlayerInfo[playerid][carZ]);
	dini_FloatSet(file, "carA", PlayerInfo[playerid][carA]);
	dini_IntSet(file, "carColor1", PlayerInfo[playerid][carColor1]);
	dini_IntSet(file, "carColor2", PlayerInfo[playerid][carColor2]);
	dini_IntSet(file, "carPaintJob", PlayerInfo[playerid][carPaintJob]);
	dini_IntSet(file, "carLicensePlate", PlayerInfo[playerid][carLicensePlate]);
	for(new i = 0; i < 13; i++){
		PlayerInfo[playerid][carMod][i] = GetVehicleComponentInSlot(PlayerInfo[playerid][carID], i);
	}
	dini_IntSet(file, "carMod1", PlayerInfo[playerid][carMod][1]);
	dini_IntSet(file, "carMod2", PlayerInfo[playerid][carMod][2]);
	dini_IntSet(file, "carMod3", PlayerInfo[playerid][carMod][3]);
	dini_IntSet(file, "carMod4", PlayerInfo[playerid][carMod][4]);
	dini_IntSet(file, "carMod5", PlayerInfo[playerid][carMod][5]);
	dini_IntSet(file, "carMod6", PlayerInfo[playerid][carMod][6]);
	dini_IntSet(file, "carMod7", PlayerInfo[playerid][carMod][7]);
	dini_IntSet(file, "carMod8", PlayerInfo[playerid][carMod][8]);
	dini_IntSet(file, "carMod9", PlayerInfo[playerid][carMod][9]);
	dini_IntSet(file, "carMod10", PlayerInfo[playerid][carMod][10]);
	dini_IntSet(file, "carMod11", PlayerInfo[playerid][carMod][11]);
	dini_IntSet(file, "carMod12", PlayerInfo[playerid][carMod][12]);
	dini_IntSet(file, "carMod13", PlayerInfo[playerid][carMod][13]);
	dini_IntSet(file, "carLocked", PlayerInfo[playerid][carLocked]);
	DestroyVehicle(PlayerInfo[playerid][carID]);
    }
	return 1;
}

public OnGameModeInit()
{
 	ShowPlayerMarkers(0);
    EnableStuntBonusForAll(0);
    DisableInteriorEnterExits();
	UsePlayerPedAnims();
	SetGameModeText("LV:RP "#gversion);
	
	// Vehicles
	
	AddStaticVehicleEx(448, 2353.0325, 2578.6294, 10.4135, 184.6771, 3, 6, 15); //PizzaBike 1
	AddStaticVehicleEx(448, 2348.7051, 2578.2756, 10.4128, 184.6772, 3, 6, 15); //PizzaBike 2
	AddStaticVehicleEx(448, 2344.5132, 2577.9324, 10.4231, 184.6841, 3, 6, 15); //PizzaBike 3
	AddStaticVehicleEx(448, 2340.4966, 2577.6030, 10.4340, 184.6890, 3, 6, 15); //PizzaBike 4
	AddStaticVehicleEx(448, 2336.0496, 2577.2371, 10.4438, 184.6937, 3, 6, 15); //PizzaBike 5

	AddStaticVehicleEx(580, 2148.7766, 1409.0737, 10.6165, 0.0, 0, 0, 15); // Dealership - Stafford
	AddStaticVehicleEx(551, 2148.7922, 1397.7976, 10.6155, 180.0, 0, 0, 15); // Dealership - Merit
	AddStaticVehicleEx(421, 2142.3120, 1397.7980, 10.7137, 180.0, 0, 0, 15); // Dealership - Washington
	AddStaticVehicleEx(550, 2135.9539, 1408.9152, 10.6700, 0.0, 0, 0, 15); // Dealership - Sunrise
	AddStaticVehicleEx(507, 2135.9248, 1397.7723, 10.6452, 180.0, 0, 0, 15); // Dealership - Elegant
	AddStaticVehicleEx(540, 2142.3110, 1408.8932, 10.6802, 360.0, 0, 0, 15); // Dealership - Vincent
	
	// Pickups
 	CreateDynamicPickup(1318,1,2779.7612,2453.8887,11.0625,0,-1,-1,50); //SubUrban1
	CreateDynamicPickup(1318,1,2474.6018,1024.2523,10.8203,0,-1,-1,50); //LVBank1
	CreateDynamicPickup(1318,1,1607.3478,1815.2412,10.8203,0,-1,-1,50); //LVHospital1
	CreateDynamicPickup(1318,1,2388.9980,2466.0288,10.8203,0,-1,-1,50); //CityHall1
	CreateDynamicPickup(1318,1,2177.6147,961.0825,10.8203,0,-1,-1,50); //AmmuNation1
	CreateDynamicPickup(1318,1,2330.6257,2533.6145,10.8203,0,-1,-1,50); //PizzaStack1
	
	// 3D Text Labels
 	CreateDynamic3DTextLabel("SubUrban", color_yellow, 2779.7612, 2453.8887, 11.0625, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); //SubUrban1 PickupText
	CreateDynamic3DTextLabel("/buyclothes", color_yellow, 203.2413, -43.2615, 1001.8047, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); //SubUrban1 InsideText
 	CreateDynamic3DTextLabel("Las Venturas Bank", color_yellow, 2474.6018, 1024.2523, 10.8203, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); //LVBank1 PickupText
	CreateDynamic3DTextLabel("Las Venturas Hospital", color_yellow, 1607.3478, 1815.2412, 10.8203, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); //LVHospital1 PickupText
	CreateDynamic3DTextLabel("City Hall", color_yellow, 2388.9980,2466.0288,10.8203, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); //CityHall1 PickupText
	CreateDynamic3DTextLabel("/getlicense", color_yellow, 361.8299,173.5219,1008.3828, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); //CityHall1 InsideText
	CreateDynamic3DTextLabel("AmmuNation", color_yellow, 2177.6147,961.0825,10.8203, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); //AmmuNation1 PickupText
	CreateDynamic3DTextLabel("/buyweapon", color_yellow, 312.5579,-166.1412,999.6010, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); //AmmuNation1 InsideText
    CreateDynamic3DTextLabel("Well Stacked Pizza", color_yellow, 2330.6257,2533.6145,10.8203, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); //PizzaStack1 PickupText
    CreateDynamic3DTextLabel("/duty", color_yellow, 364.7796, -111.9622, 1001.5059, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); //PizzaStack Office InsideText
    CreateDynamic3DTextLabel("/apply", color_yellow, 368.2992,-111.2176,1002.2758, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); //PizzaStack Office InsideText2
	CreateDynamic3DTextLabel("/buycar", color_yellow, 2152.4585,1403.3992,11.1328, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); //CarDealership BuyText
	CreateDynamic3DTextLabel("Stafford", color_lightblue, 2148.7766,1409.0737,10.6165, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); // CarText Stafford
	CreateDynamic3DTextLabel("Merit", color_lightblue, 2148.7922,1397.7976,10.6155, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); // CarText Merit
	CreateDynamic3DTextLabel("Washington", color_lightblue, 2142.3120,1397.7980,10.7137, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); // CarText Washington
	CreateDynamic3DTextLabel("Sunrise", color_lightblue, 2135.9539,1408.9152,10.6700, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); // CarText Sunrise
	CreateDynamic3DTextLabel("Elegant", color_lightblue, 2135.9248,1397.7723,10.6452, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); // CarText Elegant
	CreateDynamic3DTextLabel("Vincent", color_lightblue, 2142.3110,1408.8932,10.6802, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0); // CarText Vincent
	
	// Hospital
	CreateDynamicObject(14671, 1920.31640625, -2111.01953125, -18.32914925, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1801, 1941.83532700, -2122.62109400, -20.30699000, 0.00000000, 0.00000000, 90.00010000, 0, 0, _, 200.0);
	CreateDynamicObject(1801, 1941.80334500, -2119.29052700, -20.30699000, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1801, 1941.79443400, -2115.73510700, -20.30699000, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2596, 1945.22070300, -2121.96826200, -17.91981700, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2842, 1939.12780800, -2117.91796900, -20.32841900, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2596, 1945.14379900, -2118.51928700, -17.91984700, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2596, 1945.19641100, -2115.14428700, -17.91980200, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2225, 1938.29809600, -2116.24340800, -20.31141500, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2225, 1938.47607400, -2119.87988300, -20.31141500, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2225, 1938.52111800, -2123.18432600, -20.31141500, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2190, 1938.57055700, -2123.01928700, -19.55429800, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2190, 1938.47314500, -2119.80371100, -19.60429800, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2190, 1938.30139200, -2116.17895500, -19.57929800, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2842, 1939.16442900, -2114.37768600, -20.32841900, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2842, 1939.08447300, -2121.36938500, -20.32841900, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1998, 1935.44946300, -2123.04052700, -20.31093200, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1937.82446300, -2133.86108400, -18.33625400, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1961.55432100, -2111.84399400, -18.33625400, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1491, 1939.41870100, -2111.81079100, -20.32282300, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(18084, 1939.06909200, -2112.71948200, -16.94850900, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(18084, 1942.69873000, -2112.76318400, -16.02563500, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1912.58227500, -2111.93310500, -18.33625400, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1491, 1937.74523900, -2111.84936500, -20.32282300, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1491, 1934.72033700, -2111.90771500, -20.32282300, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1914.98645000, -2103.93725600, -18.33625400, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1930.18847656, -2135.66992188, -18.33625412, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1491, 1930.19738800, -2113.56909200, -20.32282300, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2007, 1932.14794900, -2124.12695300, -20.31532300, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2007, 1931.25524900, -2124.12304700, -20.31532300, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2000, 1930.54016100, -2124.09252900, -20.31532300, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2161, 1937.72717300, -2120.71215800, -20.27673700, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2162, 1937.72717300, -2118.94824200, -20.29505700, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2164, 1937.65991200, -2117.18237300, -20.31753000, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2167, 1937.69958500, -2116.24951200, -20.34128400, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2200, 1930.43127400, -2122.00439500, -20.31174700, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2164, 1930.34204100, -2119.80957000, -20.32644700, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2167, 1930.36035200, -2118.05297900, -20.31628400, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2161, 1937.72717300, -2120.70825200, -18.92174900, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2162, 1930.29199200, -2119.82714800, -18.54681200, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2163, 1935.51647900, -2124.58105500, -18.37262000, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2008, 1933.62536600, -2123.06372100, -20.31093200, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1806, 1934.67675781, -2123.90429688, -20.29128265, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1806, 1935.80481000, -2123.99658200, -20.29128300, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(3383, 1920.58703600, -2108.66381800, -20.31093200, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(3383, 1920.56835900, -2105.13403300, -20.31093200, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(3383, 1926.52221700, -2105.20166000, -20.31093200, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(3383, 1926.52087400, -2108.52905300, -20.31093200, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1708, 1930.94665500, -2115.77075200, -20.31097600, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1708, 1930.96411100, -2117.30078100, -20.31097600, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1722, 1934.05334500, -2112.53906300, -20.31073000, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1722, 1933.07519500, -2112.56616200, -20.31073000, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1722, 1937.52136200, -2115.07104500, -20.31073000, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1722, 1937.50659200, -2114.11669900, -20.31073000, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2146, 1923.79345700, -2103.09008800, -19.82538200, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2008, 1915.54980469, -2106.77441406, -20.31093216, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2008, 1917.38647500, -2107.59716800, -20.31093200, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2008, 1917.37487800, -2109.52661100, -20.31093200, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2190, 1928.03979500, -2105.19531300, -19.25987600, 0.00000000, 0.00000000, 45.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2190, 1927.65832500, -2108.21313500, -19.25987600, 0.00000000, 0.00000000, 135.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2190, 1921.69201700, -2108.44116200, -19.25987600, 0.00000000, 0.00000000, 135.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2190, 1921.97973600, -2105.01538100, -19.25987600, 0.00000000, 0.00000000, 45.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2164, 1927.08508300, -2100.90722700, -20.31753000, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2164, 1915.13476600, -2103.80883800, -20.31753000, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2164, 1915.13037100, -2105.53955100, -20.31753000, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2162, 1916.94689900, -2102.52343800, -20.31510200, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2162, 1915.08032200, -2110.73388700, -20.25593400, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2164, 1915.13244600, -2108.97827100, -20.31753000, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1932.77343750, -2088.22656250, -18.33625412, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1491, 1932.85376000, -2111.86303700, -20.32282300, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2371, 1920.38415500, -2101.98242200, -18.93820800, 0.00000000, 275.77530000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2381, 1919.80944800, -2103.02710000, -19.43661300, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2394, 1919.78247100, -2102.99585000, -18.81212200, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1959.89001500, -2111.81201200, -14.45475000, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1915.70764200, -2111.85986300, -14.51125100, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1726, 1944.78820800, -2103.90234400, -20.31851800, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1726, 1944.76647900, -2107.55468800, -20.31851800, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1726, 1933.97558594, -2103.00292969, -20.31851768, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1726, 1933.39257800, -2105.60644500, -20.31851800, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1726, 1933.36718750, -2107.88574219, -20.31851768, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1945.64746094, -2124.17480469, -18.33625412, 0.00000000, 0.00000000, 179.99450684, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1937.06933594, -2102.41894531, -18.33625412, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1924.75280800, -2102.42382800, -14.40436000, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1932.47009300, -2124.59228500, -18.33625400, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2762, 1942.96044922, -2108.60546875, -19.90574455, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2762, 1935.35937500, -2106.59570312, -19.90574455, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2827, 1942.83703613, -2105.15356445, -19.47394371, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2829, 1942.88098100, -2108.28271500, -19.48768200, 0.00000000, 0.00000000, 337.50000000, 0, 0, _, 200.0);
	CreateDynamicObject(2853, 1935.39978027, -2107.04101562, -19.48774147, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2297, 1941.69323700, -2111.44702100, -20.31691200, 0.00000000, 0.00000000, 135.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(18084, 1936.49108900, -2112.77563500, -17.06076600, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(18084, 1935.03869600, -2112.78588900, -17.06367500, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(18084, 1933.68432600, -2110.60961900, -17.01074400, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(18084, 1931.04016100, -2113.30322300, -16.95112600, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(12842, 1924.25085400, -2119.01538100, -19.85626000, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2457, 1918.96350100, -2113.57519500, -20.31171800, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2457, 1918.97485400, -2115.50341800, -20.31171800, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2457, 1918.99694800, -2117.37573200, -20.31171800, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2454, 1918.84252900, -2118.44018600, -20.31551200, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2455, 1917.94165000, -2118.42797900, -20.30074700, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2455, 1917.01318400, -2118.42138700, -20.30074700, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1514, 1917.99939000, -2118.45507800, -19.00640700, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(955, 1918.96545400, -2123.84228500, -19.90788500, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(956, 1917.43786600, -2123.93750000, -19.90691900, 0.00000000, 0.00000000, 191.25000000, 0, 0, _, 200.0);
	CreateDynamicObject(2431, 1915.08911100, -2114.59545900, -17.89264300, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2430, 1915.08911100, -2118.68237300, -17.92832200, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2431, 1915.66235400, -2112.03588900, -17.88418000, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1481, 1915.46496600, -2112.62597700, -19.60780700, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2130, 1915.60156300, -2114.62793000, -20.31121600, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2127, 1915.58105500, -2116.60302700, -20.31197000, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1481, 1915.49841300, -2117.73828100, -19.60780700, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1649, 1923.88037100, -2124.46289100, -18.45789700, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1649, 1915.16931200, -2106.33984400, -18.27526700, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1649, 1927.62707500, -2102.59912100, -18.31646300, 0.00000000, 0.00000000, 360.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1649, 1945.53076200, -2105.66577100, -18.13293800, 0.00000000, 0.00000000, 269.99990000, 0, 0, _, 200.0);
	CreateDynamicObject(1649, 1941.35949700, -2124.47314500, -18.16975600, 0.00000000, 0.00000000, 180.00010000, 0, 0, _, 200.0);
	CreateDynamicObject(2946, 1940.76269531, -2102.47851562, -20.31093216, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2946, 1937.57397461, -2102.46044922, -20.31093216, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2763, 1935.36547852, -2105.07592773, -19.90574455, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2762, 1935.40820312, -2108.71289062, -19.90574455, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1727, 1933.40332031, -2109.11914062, -20.31093216, 0.00000000, 0.00000000, 90.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1727, 1943.59838867, -2110.93237305, -20.31093216, 0.00000000, 0.00000000, 180.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1726, 1941.54199219, -2103.33911133, -20.31093216, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2762, 1942.52075195, -2105.11865234, -19.90574455, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1801, 1943.95593262, -2117.60424805, -20.31093216, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1801, 1943.96630859, -2121.44458008, -20.31093216, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1801, 1943.99279785, -2125.20629883, -20.31093216, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2225, 1945.25842285, -2113.69653320, -20.31093216, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2225, 1945.33605957, -2117.47241211, -20.31093216, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2225, 1945.22192383, -2121.21679688, -20.31093216, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2190, 1945.24194336, -2113.77294922, -19.58594322, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2190, 1945.29638672, -2117.53857422, -19.56094360, 0.00000000, 0.00000000, 272.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2190, 1945.19152832, -2121.27832031, -19.56094360, 0.00000000, 0.00000000, 272.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2842, 1944.03894043, -2114.04882812, -20.31093216, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2842, 1944.04858398, -2117.83081055, -20.31093216, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2842, 1944.05712891, -2121.57983398, -20.31093216, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1806, 1916.19116211, -2110.40649414, -20.29128265, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1806, 1916.19042969, -2108.51367188, -20.29128265, 0.00000000, 0.00000000, 270.00000000, 0, 0, _, 200.0);

	//PizzaStack Office
	CreateDynamicObject(2395, 368.00000000, -114.00000000, 1000.54998779, 270.00000000, 179.99450684, 179.99450684, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 368.00000000, -111.26000214, 1000.54998779, 270.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 364.26953125, -111.25976562, 1000.54998779, 270.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 364.26953125, -114.00000000, 1000.54998779, 270.00000000, 179.99450684, 179.99450684, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 371.19921875, -110.75000000, 1000.50000000, 0.00000000, 0.00000000, 270.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 371.20001221, -107.09999847, 1000.50000000, 0.00000000, 0.00000000, 270.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 368.00000000, -108.77929688, 1000.50000000, 0.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 364.26953125, -108.77929688, 1000.50000000, 0.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 363.82000732, -111.95999908, 1000.50000000, 0.00000000, 0.00000000, 90.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 363.82000732, -115.69000244, 1000.50000000, 0.00000000, 0.00000000, 90.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 370.75976562, -113.92968750, 1000.50000000, 0.00000000, 0.00000000, 179.99450684, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 367.04000854, -113.93000031, 1000.50000000, 0.00000000, 0.00000000, 179.99450684, 0, 5, _, 200.0);
	CreateDynamicObject(1536, 368.25000000, -114.04000092, 1000.50000000, 0.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(1536, 368.25000000, -114.22000122, 1000.47998047, 0.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 364.40298462, -111.28137207, 1003.20495605, 90.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 368.10000610, -111.28424072, 1003.20495605, 90.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 364.22738647, -111.28376007, 1003.20495605, 90.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 364.23437500, -108.57910156, 1003.20495605, 90.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 367.93347168, -108.57232666, 1003.20495605, 90.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2395, 368.15756226, -108.57185364, 1003.20495605, 90.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2200, 363.95001221, -112.55000305, 1000.50000000, 0.00000000, 0.00000000, 90.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2184, 367.23199463, -111.10134888, 1000.50000000, 0.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2309, 368.29885864, -109.53604126, 1000.50000000, 0.00000000, 0.00000000, 180.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2190, 367.23641968, -110.61454773, 1001.27575684, 0.00000000, 0.00000000, 140.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(1742, 371.35043335, -112.09157562, 1000.50000000, 0.00000000, 0.00000000, 270.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(1806, 369.30749512, -111.87776947, 1000.50000000, 0.00000000, 0.00000000, 25.00000000, 0, 5, _, 200.0);
	CreateDynamicObject(2841, 367.62164307, -111.58556366, 1000.50000000, 0.00000000, 0.00000000, 0.00000000, 0, 5, _, 200.0);
	
	// Jail Interior
	CreateDynamicObject(7191, 1759.33886719, -1602.47558594, 1734.94885254, 0.00000000, 359.24194336, 179.99450684, 0, 0, _, 200.0);
	CreateDynamicObject(8661, 1775.48388672, -1556.00244141, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(8661, 1775.53271484, -1575.89843750, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(8661, 1773.91601562, -1585.53906250, 1743.44299316, 271.99951172, 179.99450684, 179.99450684, 0, 0, _, 200.0);
	CreateDynamicObject(8661, 1769.37011719, -1560.26367188, 1743.89318848, 90.00000000, 179.99450684, 179.99450684, 0, 0, _, 200.0);
	CreateDynamicObject(8661, 1755.54296875, -1565.83496094, 1743.86816406, 90.00000000, 164.49829102, 285.48522949, 0, 0, _, 200.0);
	CreateDynamicObject(8661, 1780.48730469, -1566.79687500, 1743.91845703, 271.98852539, 179.99450684, 270.73608398, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1763.61584473, -1602.32543945, 1734.94885254, 0.00000000, 359.24743652, 179.99450684, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1767.83789062, -1602.22558594, 1734.94885254, 0.00000000, 359.24194336, 179.99450684, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1772.08642578, -1602.06994629, 1734.94885254, 0.00000000, 359.24743652, 179.99450684, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1776.33496094, -1601.98730469, 1734.94885254, 0.00000000, 359.24194336, 179.99450684, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1780.60839844, -1601.95703125, 1734.94885254, 0.00000000, 359.24194336, 179.99450684, 0, 0, _, 200.0);
	CreateDynamicObject(8661, 1775.95776367, -1569.56005859, 1737.71728516, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(8661, 1774.90625000, -1586.41308594, 1737.71728516, 0.00000000, 179.99450684, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1759.47070312, -1544.44384766, 1734.94885254, 0.00000000, 359.24743652, 359.99450684, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1763.72021484, -1544.37646484, 1734.94885254, 0.00000000, 359.24194336, 359.98901367, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1767.96826172, -1544.28381348, 1734.94885254, 0.00000000, 359.24194336, 359.98901367, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1772.26855469, -1544.30993652, 1734.94885254, 0.00000000, 359.24194336, 359.98901367, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1776.52319336, -1544.21215820, 1734.94885254, 0.00000000, 359.24194336, 359.98901367, 0, 0, _, 200.0);
	CreateDynamicObject(7191, 1780.51928711, -1544.10156250, 1734.94885254, 0.00000000, 359.24194336, 0.48901367, 0, 0, _, 200.0);
	CreateDynamicObject(8661, 1775.49218750, -1559.57812500, 1737.69348145, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(8661, 1774.38708496, -1566.65051270, 1737.69348145, 0.00000000, 179.99450684, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2205, 1778.93627930, -1571.53637695, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2205, 1778.02148438, -1572.87792969, 1733.94299316, 0.00000000, 0.00000000, 89.49462891, 0, 0, _, 200.0);
	CreateDynamicObject(2205, 1779.34375000, -1573.83203125, 1733.94299316, 0.00000000, 0.00000000, 178.98925781, 0, 0, _, 200.0);
	CreateDynamicObject(2190, 1779.52197266, -1571.44006348, 1734.87951660, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2190, 1777.92187500, -1572.66064453, 1734.87951660, 0.00000000, 0.00000000, 89.25000000, 0, 0, _, 200.0);
	CreateDynamicObject(2776, 1779.93103027, -1572.26440430, 1734.44042969, 0.00000000, 0.00000000, 232.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(14819, 1780.77575684, -1575.82714844, 1735.09289551, 358.25003052, 0.25012207, 91.25765991, 0, 0, _, 200.0);
	CreateDynamicObject(14401, 1767.80371094, -1573.59082031, 1734.26867676, 0.00000000, 0.00000000, 91.98852539, 0, 0, _, 200.0);
	CreateDynamicObject(2828, 1778.97924805, -1573.73181152, 1734.87951660, 0.00000000, 0.00000000, 326.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2602, 1758.99340820, -1561.92602539, 1734.46643066, 0.00000000, 0.00000000, 268.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(2602, 1763.21862793, -1561.89965820, 1734.46643066, 0.00000000, 0.00000000, 267.99499512, 0, 0, _, 200.0);
	CreateDynamicObject(2602, 1767.51782227, -1561.87219238, 1734.46643066, 0.00000000, 0.00000000, 267.99499512, 0, 0, _, 200.0);
	CreateDynamicObject(2602, 1771.80627441, -1561.85754395, 1734.46643066, 0.00000000, 0.00000000, 267.99499512, 0, 0, _, 200.0);
	CreateDynamicObject(2602, 1776.07934570, -1561.99621582, 1734.46643066, 0.00000000, 0.00000000, 267.99499512, 0, 0, _, 200.0);
	CreateDynamicObject(2602, 1780.05236816, -1561.72045898, 1734.46643066, 0.00000000, 0.00000000, 267.99499512, 0, 0, _, 200.0);
	CreateDynamicObject(2602, 1780.11157227, -1582.58886719, 1734.46643066, 0.00000000, 0.00000000, 267.99499512, 0, 0, _, 200.0);
	CreateDynamicObject(2602, 1775.85107422, -1583.17675781, 1734.46643066, 0.00000000, 0.00000000, 267.99499512, 0, 0, _, 200.0);
	CreateDynamicObject(2602, 1771.56579590, -1583.76806641, 1734.46643066, 0.00000000, 0.00000000, 267.99499512, 0, 0, _, 200.0);
	CreateDynamicObject(2602, 1767.33007812, -1584.35205078, 1734.46643066, 0.00000000, 0.00000000, 267.99499512, 0, 0, _, 200.0);
	CreateDynamicObject(2602, 1762.99975586, -1584.06530762, 1734.46643066, 0.00000000, 0.00000000, 267.99499512, 0, 0, _, 200.0);
	CreateDynamicObject(2602, 1758.80371094, -1584.39086914, 1734.46643066, 0.00000000, 0.00000000, 267.99499512, 0, 0, _, 200.0);
	CreateDynamicObject(1800, 1756.03723145, -1585.60107422, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1800, 1759.98681641, -1585.61987305, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1800, 1764.23559570, -1585.63989258, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1800, 1768.43603516, -1585.66015625, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1800, 1772.66125488, -1585.68078613, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1800, 1776.93542480, -1585.70153809, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1800, 1777.15283203, -1565.10754395, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1800, 1772.90209961, -1565.10156250, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1800, 1768.62707520, -1565.11926270, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1800, 1764.37670898, -1565.11328125, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1800, 1760.10144043, -1565.10632324, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);
	CreateDynamicObject(1800, 1756.10107422, -1565.09887695, 1733.94299316, 0.00000000, 0.00000000, 0.00000000, 0, 0, _, 200.0);

	// Cell gates
	cellGates[0][0] = CreateDynamicObject(7657, 1778.52160645, -1566.82812500, 1735.73657227, 0.00000000, 90.00000000, 179.99450684, 0, 0, _, 200.0);
	cellGates[1][0] = CreateDynamicObject(7657, 1774.39318848, -1566.82873535, 1735.73657227, 0.00000000, 90.00000000, 180.00000000, 0, 0, _, 200.0);
	cellGates[2][0] = CreateDynamicObject(7657, 1770.06335449, -1566.82812500, 1735.73657227, 0.00000000, 90.00000000, 179.99450684, 0, 0, _, 200.0);
	cellGates[3][0] = CreateDynamicObject(7657, 1765.75830078, -1566.82812500, 1735.73657227, 0.00000000, 90.00000000, 179.99450684, 0, 0, _, 200.0);
	cellGates[4][0] = CreateDynamicObject(7657, 1761.55371094, -1566.82812500, 1735.73657227, 0.00000000, 90.00000000, 179.99450684, 0, 0, _, 200.0);
	cellGates[5][0] = CreateDynamicObject(7657, 1757.27453613, -1566.82812500, 1735.73657227, 0.00000000, 90.00000000, 179.99450684, 0, 0, _, 200.0);
	cellGates[6][0] = CreateDynamicObject(7657, 1757.24633789, -1579.99633789, 1735.73657227, 0.00000000, 90.00000000, 0.00000000, 0, 0, _, 200.0);
	cellGates[7][0] = CreateDynamicObject(7657, 1761.55395508, -1579.86120605, 1735.73657227, 0.00000000, 90.00000000, 0.00000000, 0, 0, _, 200.0);
	cellGates[8][0] = CreateDynamicObject(7657, 1765.73645020, -1579.73156738, 1735.73657227, 0.00000000, 90.00000000, 0.00000000, 0, 0, _, 200.0);
	cellGates[9][0] = CreateDynamicObject(7657, 1769.99047852, -1579.52392578, 1735.73657227, 0.00000000, 90.00000000, 0.00000000, 0, 0, _, 200.0);
	cellGates[10][0] = CreateDynamicObject(7657, 1774.27429199, -1579.41479492, 1735.73657227, 0.00000000, 90.00000000, 0.00000000, 0, 0, _, 200.0);
	cellGates[11][0] = CreateDynamicObject(7657, 1778.48120117, -1579.28405762, 1735.73657227, 0.00000000, 90.00000000, 0.00000000, 0, 0, _, 200.0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetSpawnInfo(playerid, 0, 299, 1680, 1447.75 ,10.77, 270, 0, 0, 0, 0, 0, 0);
	SpawnPlayer(playerid);
	return 1;
}

public OnPlayerConnect(playerid)
{
    PlayerInfo[playerid][LoggedIn] = 0;
	new pName[MAX_PLAYER_NAME];
	new file[255];
	GetPlayerName(playerid, pName, sizeof(pName));
	format(file, sizeof(file), "/players/%s.ini", pName);
	if(!fexist(file)){
		ShowPlayerDialog(playerid, registerdialog, DIALOG_STYLE_INPUT, "Register", "Input a password to register this account", "Register", "Cancel");
	} else {
		ShowPlayerDialog(playerid, logindialog, DIALOG_STYLE_INPUT, "Login", "Input your password to log in", "Login", "Cancel");
	}
	if(PlayerInfo[playerid][Duty] == 1){
    	SetPlayerColor(playerid, color_orange);
    } else {
    	SetPlayerColor(playerid, color_white);
    }
    
	// Map Icons
	SetPlayerMapIcon(playerid, 0, 2779.7612, 2453.8887, 11.0625, 45, 0, MAPICON_LOCAL); // Clothes Store Icon
	SetPlayerMapIcon(playerid, 1, 2474.6018, 1024.2523, 10.8203, 52, 0, MAPICON_LOCAL); // Bank Icon
	SetPlayerMapIcon(playerid, 2, 1607.3478, 1815.2412, 10.8203, 22, 0, MAPICON_LOCAL); // LVHospital Icon
	SetPlayerMapIcon(playerid, 3, 2388.9980, 2466.0288, 10.8203, 19, 0, MAPICON_LOCAL); // CityHall Icon
	SetPlayerMapIcon(playerid, 4, 2177.6147, 961.0825, 10.8203, 6, 0, MAPICON_LOCAL); // AmmuNation Icon
	SetPlayerMapIcon(playerid, 5, 2330.6257,2533.6145,10.8203, 29, 0, MAPICON_LOCAL); // PizzaStack Icon
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    DestroyObject(GetPVarInt(playerid, "pizzabox"));
	SavePlayer(playerid);
    return 1;
}

public OnPlayerSpawn(playerid)
{
	SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
 	SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
	SetCameraBehindPlayer(playerid);
	ApplyAnimation(playerid,"CRACK","null",0.0,0,0,0,0,0);
	if(PlayerInfo[playerid][Jailed] == 1){
		jailPlayer(playerid);
	} else if(PlayerInfo[playerid][Dead] == 1){
		SetPlayerHealth(playerid, 1.0);
	    healPlayer(playerid);
    } else if(PlayerInfo[playerid][Duty] == 1){
		SetPlayerSkin(playerid, 155);
		SetPlayerInterior(playerid, PlayerInfo[playerid][pI]);
		SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
		SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pA]);
	} else {
		SetPlayerInterior(playerid, PlayerInfo[playerid][pI]);
		SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
		SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pA]);
	}
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	GameTextForPlayer(playerid, "~w~Wasted", 3000, 2);
	ResetPlayerWeapons(playerid);
	PlayerInfo[playerid][Weapon] = 0;
	PlayerInfo[playerid][Ammo] = 0;
	PlayerInfo[playerid][Dead] = 1;
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	if(PlayerInfo[playerid][Muted] == 1){
		SendClientMessage(playerid, color_gray, "You are muted!");
	} else {
		new string[128];
		format(string,sizeof(string),"%s says: %s", RemoveUnderscore(playerid),text);
		NearByMessage(playerid,color_white,string,12.0);
	}
	return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2){
		if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448){
		    if(PlayerInfo[playerid][Job] != 1){
				RemovePlayerFromVehicle(playerid);
				SendClientMessage(playerid, color_red, "ERROR: You are not a pizza boy!");
			} else if(PlayerInfo[playerid][Duty] != 1){
			    RemovePlayerFromVehicle(playerid);
			    SendClientMessage(playerid, color_red, "ERROR: You need to be on duty to drive a pizza boy bike!");
			}
		}
	}
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448 && PlayerInfo[playerid][Duty] == 1 && PlayerInfo[playerid][Delivered] == 1){
    	new rndPizza = random(sizeof(randomPizza)), Float: pizzaX = randomPizza[rndPizza][0], Float: pizzaY = randomPizza[rndPizza][1], Float: pizzaZ = randomPizza[rndPizza][2];
    	PlayerInfo[playerid][Delivered] = 2;
		DisablePlayerCheckpoint(playerid);
		SetPVarInt(playerid, "pizzabox", CreateObject(1582, 0.0, 0.0, 0.0, 0.0, 0.0, 96.0));
		AttachObjectToVehicle(GetPVarInt(playerid, "pizzabox"), (GetPlayerVehicleID(playerid)), 0.0, -0.95, 0.5, 0.0, 0.0, 0.0);
 		SendClientMessage(playerid, color_white, "Go to the checkpoint to deliver the order!");
        SetPlayerCheckpoint(playerid, Float: pizzaX, Float: pizzaY, Float: pizzaZ, 3.0);
	} else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448 && PlayerInfo[playerid][Duty] == 1 && PlayerInfo[playerid][Delivered] == 2){
    	PlayerInfo[playerid][Delivered] = 3;
		DisablePlayerCheckpoint(playerid);
		DestroyObject(GetPVarInt(playerid, "pizzabox"));
		SendClientMessage(playerid, color_white, "You have delivered the order, return to Well Stacked Pizza to finish your delivery!");
        SetPlayerCheckpoint(playerid, 2330.6257, 2533.6145, 10.8203, 3.0);
	} else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448 && PlayerInfo[playerid][Duty] == 1 && PlayerInfo[playerid][Delivered] == 3){
	    PlayerInfo[playerid][Delivered] = 0;
	    PlayerInfo[playerid][PizzaDeliveries]++;
		DisablePlayerCheckpoint(playerid);
    	SendClientMessage(playerid, color_white, "You have completed your delivery!");
	} else if(PlayerInfo[playerid][carTracking] == 1){
		DisablePlayerCheckpoint(playerid);
		PlayerInfo[playerid][carTracking] = 0;
	}
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	PlayerInfo[playerid][carPaintJob] = paintjobid;
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	PlayerInfo[playerid][carColor1] = color1;
	PlayerInfo[playerid][carColor2] = color2;
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	new cWeapon = GetPlayerWeapon(playerid);
	if((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE) && cWeapon != 0){
		PlayerInfo[playerid][Ammo] = GetPlayerAmmo(playerid);
	}
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	new cWeapon = GetPlayerWeapon(playerid);
	if(cWeapon != 0 && cWeapon != PlayerInfo[playerid][Weapon]){
	    ResetPlayerWeapons(playerid);
		GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon], PlayerInfo[playerid][Ammo]);
	} else {
		ResetPlayerMoney(playerid);
		GivePlayerMoney(playerid, PlayerInfo[playerid][Money]);
		PlayerInfo[playerid][pI] = GetPlayerInterior(playerid);
		GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
		GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pA]);
	}
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	for(new i = 0; i < MAX_PLAYERS; i++){
		if(vehicleid == PlayerInfo[i][carID] && PlayerInfo[i][carLocked] == 1){
			SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
		}
	}
	switch(vehicleid){
	case 6: SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1);
	case 7: SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1);
	case 8: SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1);
	case 9: SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1);
	case 10: SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1);
	case 11: SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1);
	}
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	new pName[MAX_PLAYER_NAME];
	new file[255];
	GetPlayerName(playerid, pName, sizeof(pName));
	format(file, sizeof(file), "/players/%s.ini", pName);
	// Register Dialog
	if(dialogid == registerdialog){
		if(response){
			if(strlen(inputtext) < 3 || strlen(inputtext) > 20){
				SendClientMessage(playerid, color_red, "ERROR: Your password must have between 3 and 20 characters");
				ShowPlayerDialog(playerid, registerdialog, 1, "Register", "Input a password to register this account", "Register", "Cancel");
			} else {
				dini_Create(file);
				dini_IntSet(file, "Password", udb_hash(inputtext));
				dini_IntSet(file, "Level", 1);
				dini_IntSet(file, "AdminLevel", 0);
				dini_IntSet(file, "Money", 500);
				dini_FloatSet(file, "pX", 1680);
				dini_FloatSet(file, "pY", 1447.75);
				dini_FloatSet(file, "pZ", 10.75);
				dini_FloatSet(file, "pA", 270);
				dini_IntSet(file, "pI", 0);
				dini_IntSet(file, "Bank", 500);
				dini_IntSet(file, "Skin", 299);
				dini_IntSet(file, "Jailed", 0);
				dini_IntSet(file, "jTime", 0);
				dini_IntSet(file, "Muted", 0);
				dini_IntSet(file, "Dead", 0);
				dini_IntSet(file, "ArmsLicense", 0);
				dini_IntSet(file, "Weapon", 0);
				dini_IntSet(file, "Ammo", 0);
				dini_IntSet(file, "Job", 0);
				dini_IntSet(file, "Duty", 0);
				dini_IntSet(file, "PizzaDeliveries", 0);
				dini_IntSet(file, "DriverLicense", 0);
				dini_IntSet(file, "carModel", 0);
				dini_FloatSet(file, "carX", 0.0);
				dini_FloatSet(file, "carY", 0.0);
				dini_FloatSet(file, "carZ", 0.0);
				dini_FloatSet(file, "carA", 0.0);
				dini_IntSet(file, "carColor1", 0);
				dini_IntSet(file, "carColor2", 0);
				dini_IntSet(file, "carPaintJob", 0);
				dini_IntSet(file, "carLicensePlate", 0);
				dini_IntSet(file, "carMod1", 0);
				dini_IntSet(file, "carMod2", 0);
				dini_IntSet(file, "carMod3", 0);
				dini_IntSet(file, "carMod4", 0);
				dini_IntSet(file, "carMod5", 0);
				dini_IntSet(file, "carMod6", 0);
				dini_IntSet(file, "carMod7", 0);
				dini_IntSet(file, "carMod8", 0);
				dini_IntSet(file, "carMod9", 0);
				dini_IntSet(file, "carMod10", 0);
				dini_IntSet(file, "carMod11", 0);
				dini_IntSet(file, "carMod12", 0);
				dini_IntSet(file, "carMod13", 0);
				dini_IntSet(file, "carLocked", 0);
				SendClientMessage(playerid, color_white, "SERVER: You've successfully logged in!");
				PlayerInfo[playerid][LoggedIn] = 1;
				PlayerInfo[playerid][Level] = dini_Int(file, "Level");
				PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
				PlayerInfo[playerid][Money] = dini_Int(file, "Money");
				PlayerInfo[playerid][pX] = dini_Float(file, "pX");
				PlayerInfo[playerid][pY] = dini_Float(file, "pY");
				PlayerInfo[playerid][pZ] = dini_Float(file, "pZ");
				PlayerInfo[playerid][pA] = dini_Float(file, "pA");
				PlayerInfo[playerid][pI] = dini_Int(file, "pI");
				PlayerInfo[playerid][Bank] = dini_Int(file, "Bank");
				PlayerInfo[playerid][Skin] = dini_Int(file, "Skin");
				PlayerInfo[playerid][Jailed] = dini_Int(file, "Jailed");
				PlayerInfo[playerid][jTime] = dini_Int(file, "jTime");
				PlayerInfo[playerid][Muted] = dini_Int(file, "Muted");
				PlayerInfo[playerid][Dead] = dini_Int(file, "Dead");
				PlayerInfo[playerid][ArmsLicense] = dini_Int(file, "ArmsLicense");
				PlayerInfo[playerid][Weapon] = dini_Int(file, "Weapon");
				PlayerInfo[playerid][Ammo] = dini_Int(file, "Ammo");
				PlayerInfo[playerid][Job] = dini_Int(file, "Job");
				PlayerInfo[playerid][Duty] = dini_Int(file, "Duty");
				PlayerInfo[playerid][PizzaDeliveries] = dini_Int(file, "PizzaDeliveries");
				PlayerInfo[playerid][DriverLicense] = dini_Int(file, "DriverLicense");
				PlayerInfo[playerid][carModel] = dini_Int(file, "carModel");
				PlayerInfo[playerid][carX] = dini_Float(file, "carX");
				PlayerInfo[playerid][carY] = dini_Float(file, "carY");
				PlayerInfo[playerid][carZ] = dini_Float(file, "carZ");
				PlayerInfo[playerid][carA] = dini_Float(file, "carA");
				PlayerInfo[playerid][carColor1] = dini_Int(file, "carColor1");
				PlayerInfo[playerid][carColor2] = dini_Int(file, "carColor2");
				PlayerInfo[playerid][carPaintJob] = dini_Int(file, "carPaintJob");
				PlayerInfo[playerid][carLicensePlate] = dini_Int(file, "carLicensePlate");
				PlayerInfo[playerid][carMod][1] = dini_Int(file, "carMod1");
				PlayerInfo[playerid][carMod][2] = dini_Int(file, "carMod2");
				PlayerInfo[playerid][carMod][3] = dini_Int(file, "carMod3");
				PlayerInfo[playerid][carMod][4] = dini_Int(file, "carMod4");
				PlayerInfo[playerid][carMod][5] = dini_Int(file, "carMod5");
				PlayerInfo[playerid][carMod][6] = dini_Int(file, "carMod6");
				PlayerInfo[playerid][carMod][7] = dini_Int(file, "carMod7");
				PlayerInfo[playerid][carMod][8] = dini_Int(file, "carMod8");
				PlayerInfo[playerid][carMod][9] = dini_Int(file, "carMod9");
				PlayerInfo[playerid][carMod][10] = dini_Int(file, "carMod10");
				PlayerInfo[playerid][carMod][11] = dini_Int(file, "carMod11");
				PlayerInfo[playerid][carMod][12] = dini_Int(file, "carMod12");
				PlayerInfo[playerid][carMod][13] = dini_Int(file, "carMod13");
				PlayerInfo[playerid][carLocked] = dini_Int(file, "carLocked");
				PlayerInfo[playerid][carDeal] = -1;
				GivePlayerMoney(playerid,PlayerInfo[playerid][Money]);
				GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon],PlayerInfo[playerid][Ammo]);
			}
		} else{
			ShowPlayerDialog(playerid, registerdialog, 1, "Register", "Input a password to register this account", "Register", "Cancel");
		}
	}

	// Login Dialog
	else if(dialogid == logindialog){
		new logintries[MAX_PLAYERS] = 0;
		if(response){
			new pswdtmp[255];
			pswdtmp = dini_Get(file, "Password");
			if(udb_hash(inputtext) == strval(pswdtmp)){
				PlayerInfo[playerid][LoggedIn] = 1;
				PlayerInfo[playerid][Level] = dini_Int(file, "Level");
				PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
				PlayerInfo[playerid][Money] = dini_Int(file, "Money");
				PlayerInfo[playerid][pX] = dini_Float(file, "pX");
				PlayerInfo[playerid][pY] = dini_Float(file, "pY");
				PlayerInfo[playerid][pZ] = dini_Float(file, "pZ");
				PlayerInfo[playerid][pA] = dini_Float(file, "pA");
				PlayerInfo[playerid][pI] = dini_Int(file, "pI");
				PlayerInfo[playerid][Bank] = dini_Int(file, "Bank");
				PlayerInfo[playerid][Skin] = dini_Int(file, "Skin");
				PlayerInfo[playerid][Jailed] = dini_Int(file, "Jailed");
				PlayerInfo[playerid][jTime] = dini_Int(file, "jTime");
				PlayerInfo[playerid][Muted] = dini_Int(file, "Muted");
				PlayerInfo[playerid][Dead] = dini_Int(file, "Dead");
				PlayerInfo[playerid][ArmsLicense] = dini_Int(file, "ArmsLicense");
				PlayerInfo[playerid][Weapon] = dini_Int(file, "Weapon");
				PlayerInfo[playerid][Ammo] = dini_Int(file, "Ammo");
				PlayerInfo[playerid][Job] = dini_Int(file, "Job");
				PlayerInfo[playerid][Duty] = dini_Int(file, "Duty");
				PlayerInfo[playerid][PizzaDeliveries] = dini_Int(file, "PizzaDeliveries");
				PlayerInfo[playerid][DriverLicense] = dini_Int(file, "DriverLicense");
				PlayerInfo[playerid][carModel] = dini_Int(file, "carModel");
				PlayerInfo[playerid][carX] = dini_Float(file, "carX");
				PlayerInfo[playerid][carY] = dini_Float(file, "carY");
				PlayerInfo[playerid][carZ] = dini_Float(file, "carZ");
				PlayerInfo[playerid][carA] = dini_Float(file, "carA");
				PlayerInfo[playerid][carColor1] = dini_Int(file, "carColor1");
				PlayerInfo[playerid][carColor2] = dini_Int(file, "carColor2");
				PlayerInfo[playerid][carPaintJob] = dini_Int(file, "carPaintJob");
				PlayerInfo[playerid][carLicensePlate] = dini_Int(file, "carLicensePlate");
				PlayerInfo[playerid][carMod][1] = dini_Int(file, "carMod1");
				PlayerInfo[playerid][carMod][2] = dini_Int(file, "carMod2");
				PlayerInfo[playerid][carMod][3] = dini_Int(file, "carMod3");
				PlayerInfo[playerid][carMod][4] = dini_Int(file, "carMod4");
				PlayerInfo[playerid][carMod][5] = dini_Int(file, "carMod5");
				PlayerInfo[playerid][carMod][6] = dini_Int(file, "carMod6");
				PlayerInfo[playerid][carMod][7] = dini_Int(file, "carMod7");
				PlayerInfo[playerid][carMod][8] = dini_Int(file, "carMod8");
				PlayerInfo[playerid][carMod][9] = dini_Int(file, "carMod9");
				PlayerInfo[playerid][carMod][10] = dini_Int(file, "carMod10");
				PlayerInfo[playerid][carMod][11] = dini_Int(file, "carMod11");
				PlayerInfo[playerid][carMod][12] = dini_Int(file, "carMod12");
				PlayerInfo[playerid][carMod][13] = dini_Int(file, "carMod13");
				PlayerInfo[playerid][carLocked] = dini_Int(file, "carLocked");
				PlayerInfo[playerid][carDeal] = -1;
				SendClientMessage(playerid, color_white, "SERVER: You've logged in successfully!");
				GivePlayerMoney(playerid,PlayerInfo[playerid][Money]);
				GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon],PlayerInfo[playerid][Ammo]);
				CreatePlayerVehicle(playerid);
			} else{
				logintries[playerid]++;
				SendClientMessage(playerid, color_red, "ERROR: Incorrect Password!");
				if(logintries[playerid] == 2){
				Kick(playerid);
				} else {
					ShowPlayerDialog(playerid, logindialog, DIALOG_STYLE_INPUT, "Login", "Input your password to log in", "Login", "Cancel");
				}
			}
		} else {
			Kick(playerid);
		}
	}

	//SkinSelector Dialog
	else if(dialogid==2){
		if(response){
			if(IsValidSkin(strval(inputtext))){
				SetPlayerSkin(playerid, strval(inputtext));
				PlayerInfo[playerid][Skin] = strval(inputtext);
				GivePlayerMoneyEx(playerid, -50);
			}else{
				ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Select Clothes", "Insert the ID of the skin.", "Submit", "Cancel");
			}
		}
	}
	
	//BankDeposit Dialog
	else if(dialogid==3){
		if(response && strval(inputtext) > 0){
			if(strval(inputtext) <= PlayerInfo[playerid][Money]){
			GivePlayerMoneyEx(playerid, -strval(inputtext));
			PlayerInfo[playerid][Bank] += strval(inputtext);
			} else {
				return SendClientMessage(playerid, color_gray, "You don't have that money!");
			}
		}
	}
	
	//BankWithdraw Dialog
	else if(dialogid==4){
		if(response && strval(inputtext) > 0){
			if(strval(inputtext) <= PlayerInfo[playerid][Bank]){
			GivePlayerMoneyEx(playerid, strval(inputtext));
			PlayerInfo[playerid][Bank] -= strval(inputtext);
			} else {
				return SendClientMessage(playerid, color_gray, "You don't have that money!");
			}
		}
	}
	
    //License Dialog
	else if(dialogid==5){
		if(response){
   			switch(listitem)
 			{
				case 0:
				{
					if(PlayerInfo[playerid][Money] < 100){
				        return SendClientMessage(playerid, color_gray, "You don't have enough money to acquire this license!");
					} else if(PlayerInfo[playerid][DriverLicense] == 0){
						PlayerInfo[playerid][DriverLicense] = 1;
						GivePlayerMoneyEx(playerid, -100);
						SendClientMessage(playerid, color_white, "You have acquired the Driver License!");
					} else {
						return SendClientMessage(playerid, color_gray, "You already own this license!");
					}
				}
				case 1:
				{
				    if(PlayerInfo[playerid][Money] < 200){
				        return SendClientMessage(playerid, color_gray, "You don't have enough money to acquire this license!");
					} else if(PlayerInfo[playerid][ArmsLicense] == 0){
						PlayerInfo[playerid][ArmsLicense] = 1;
						GivePlayerMoneyEx(playerid, -200);
						SendClientMessage(playerid, color_white, "You have acquired the Federal Firearms License!");
						SendClientMessage(playerid, color_white, "You are now allowed to acquire and use legal weapons!");
					} else {
						return SendClientMessage(playerid, color_gray, "You already own this license!");
					}
				}
			}
		}
	}
	//Weapons Dialog
	else if(dialogid==6){
		if(response){
			if(PlayerInfo[playerid][Weapon] == 0){
				switch(listitem)
				{
					case 0:
					{
						if(PlayerInfo[playerid][Money] < 300){
							return SendClientMessage(playerid, color_gray, "You don't have enough money to buy this weapon!");
						} else if(PlayerInfo[playerid][Weapon] == 22){
							return SendClientMessage(playerid, color_gray, "You already have this weapon!");
						} else {
						PlayerInfo[playerid][Weapon] = 0;
						PlayerInfo[playerid][Ammo] = 0;
						GivePlayerWeaponEx(playerid, 22, 15);
						GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon],PlayerInfo[playerid][Ammo]);
						GivePlayerMoneyEx(playerid, -300);
						SendClientMessage(playerid, color_white, "You have acquired a M1911!");
						}
					}
					case 1:
					{
						if(PlayerInfo[playerid][Money] < 450){
							return SendClientMessage(playerid, color_gray, "You don't have enough money to buy this weapon!");
						} else if(PlayerInfo[playerid][Weapon] == 25){
							return SendClientMessage(playerid, color_gray, "You already have this weapon!");
						} else {
						PlayerInfo[playerid][Weapon] = 0;
						PlayerInfo[playerid][Ammo] = 0;
						GivePlayerWeaponEx(playerid, 25, 10);
						GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon],PlayerInfo[playerid][Ammo]);
						GivePlayerMoneyEx(playerid, -450);
						SendClientMessage(playerid, color_white, "You have acquired a Remington 870!");
						}
					}
					case 2:
					{
						if(PlayerInfo[playerid][Money] < 600){
							return SendClientMessage(playerid, color_gray, "You don't have enough money to buy this weapon!");
						} else if(PlayerInfo[playerid][Weapon] == 33){
							return SendClientMessage(playerid, color_gray, "You already have this weapon!");
						} else {
						PlayerInfo[playerid][Weapon] = 0;
						PlayerInfo[playerid][Ammo] = 0;
						GivePlayerWeaponEx(playerid, 33, 5);
						GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon],PlayerInfo[playerid][Ammo]);
						GivePlayerMoneyEx(playerid, -600);
						SendClientMessage(playerid, color_white, "You have acquired a Springfield M1903!");
						}
					}
					case 3:
					{
						ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "Select the type of ammo you want to buy.", "9mm ($10 for 15)\n12 Gauge ($25 for 10)\n.30-06 ($10 for 5)", "Buy", "Cancel");
					}
				}
			} else {
				return SendClientMessage(playerid, color_gray, "You already have a weapon!");
			}
		}
	}
	//Ammo Dialog
	else if(dialogid==7){
		if(response){
   			switch(listitem)
 			{
				case 0:
				{
				    if(PlayerInfo[playerid][Money] < 7){
				        return SendClientMessage(playerid, color_gray, "You don't have enough money to buy ammo!");
					} else if(PlayerInfo[playerid][Weapon] == 22){
						PlayerInfo[playerid][Ammo] = 0;
				    	GivePlayerWeaponEx(playerid, 22, 15);
				    	GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon],PlayerInfo[playerid][Ammo]);
				    	GivePlayerMoneyEx(playerid, -10);
						SendClientMessage(playerid, color_white, "You have acquired ammo for your M1911!");
					} else {
						return SendClientMessage(playerid, color_gray, "You don't have a M1911!");
					}
				}
				case 1:
				{
    				if(PlayerInfo[playerid][Money] < 25){
						return SendClientMessage(playerid, color_gray, "You don't have enough money to buy ammo!");
					} else if(PlayerInfo[playerid][Weapon] == 25){
						PlayerInfo[playerid][Ammo] = 0;
			    		GivePlayerWeaponEx(playerid, 25, 10);
				    	GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon],PlayerInfo[playerid][Ammo]);
				    	GivePlayerMoneyEx(playerid, -25);
						SendClientMessage(playerid, color_white, "You have acquired ammo for your Remington 870!");
					} else {
						return SendClientMessage(playerid, color_gray, "You don't have a Remington 870!");
					}
				}
				case 2:
				{
				    if(PlayerInfo[playerid][Money] < 13){
				        return SendClientMessage(playerid, color_gray, "You don't have enough money to buy ammo!");
					} else if(PlayerInfo[playerid][Weapon] == 33){
						PlayerInfo[playerid][Ammo] = 0;
			    		GivePlayerWeaponEx(playerid, 33, 5);
				    	GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon],PlayerInfo[playerid][Ammo]);
				    	GivePlayerMoneyEx(playerid, -10);
						SendClientMessage(playerid, color_white, "You have acquired ammo for your Springfield M1903!");
					} else {
						return SendClientMessage(playerid, color_gray, "You don't have a Springfield M1903!");
					}
				}
			}
		}
	}
	//Pizza Application Dialog
	else if(dialogid==8){
		if(response){
				ShowPlayerDialog(playerid, 9, DIALOG_STYLE_MSGBOX, "Pizza Boy Job Application", "Can you drive a motorbike?", "Yes", "No");
			} else {
				return SendClientMessage(playerid, color_gray, "Sorry, but you need to be older than 18 for this job!");
			}
	}
	//Pizza Application Dialog
	else if(dialogid==9){
		if(response){
				ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "Pizza Boy Job Application", "Do you know your way around Las Venturas?", "Yes", "No");
			} else {
				return SendClientMessage(playerid, color_gray, "Sorry, but you need to be able to drive a motorbike!");
			}
	}
	//Pizza Application Dialog
	else if(dialogid==10){
		if(response){
				ShowPlayerDialog(playerid, 11, DIALOG_STYLE_INPUT, "Pizza Boy Job Application", "How many Well Stacked Pizza locals are there in Las Venturas?", "Submit", "Cancel");
			} else {
				return SendClientMessage(playerid, color_gray, "Sorry, but you need to know your way around Las Venturas!");
			}
	}
	//Pizza Application Dialog
	else if(dialogid==11){
		if(response){
			if(strval(inputtext) == 4){
   				ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "Pizza Boy Job Application", "How many ingredients does a normal pizza has?", "Submit", "Cancel");
   			} else {
      			return SendClientMessage(playerid, color_gray, "Sorry, wrong answer, look around Las Venturas to find the correct answer.");
      		}
		}
	}
	//Pizza Application Dialog
	else if(dialogid==12){
		if(response){
			if(strval(inputtext) == 4){
			    PlayerInfo[playerid][Job] = 1;
   				SendClientMessage(playerid, color_white, "After reviewing your answer I have concluded that you are accepted!");
   				SendClientMessage(playerid, color_white, "Here are the keys for your locker, get your uniform from it and start delivering!");
      		} else {
        		return SendClientMessage(playerid, color_gray, "Sorry, wrong answer, look at our pizza menu to find the correct answer.");
      		}
		}
	}
	//Car Dealership Dialog
	else if(dialogid==13){
		if(response){
			switch(listitem){
				case 0:{
					BuyDealershipVehicle(playerid, 3500, 580);
				}
				case 1:{
					BuyDealershipVehicle(playerid, 3500, 421);
				}
				case 2:{
					BuyDealershipVehicle(playerid, 4000, 550);
				}
				case 3:{
					BuyDealershipVehicle(playerid, 4000, 507);
				}
				case 4:{
					BuyDealershipVehicle(playerid, 4000, 551);
				}
				case 5:{
					BuyDealershipVehicle(playerid, 4500, 540);
				}
			}
		}
	}
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++ Commands +++++++++++++++++++++++++++++++++++++++++++++++++++

CMD:setadmin(playerid, params[]){
 	if(PlayerInfo[playerid][AdminLevel] > 5){
		new targetid, alvl;
		if(sscanf(params, "ui", targetid, alvl)){
			return SendClientMessage(playerid, color_gray, "Usage: /setadmin [ID] [Admin Level]");
		} else if(alvl > 6 && alvl < -1){
			return SendClientMessage(playerid, color_gray, "Invalid Admin Level!");
		} else if(targetid == playerid){
			return SendClientMessage(playerid, color_gray, "You can't change your own admin level!");
		} else if(!IsPlayerConnected(targetid)){
				return SendClientMessage(playerid, color_gray, "User not online.");
			} else if(PlayerInfo[targetid][AdminLevel] >= PlayerInfo[playerid][AdminLevel]){
				return SendClientMessage(playerid, color_gray, "You can't change the rank of a higher rank admin!");
			} else {
				new aString[128], pString[128], pName[MAX_PLAYER_NAME], pdmo[9], atitle[24];
				GetPlayerName(targetid, pName, sizeof(pName));
				if(alvl == 0){
					format(pString, sizeof(pString), "You have been kicked from the Administration Team by %s.", RemoveUnderscore(playerid));
					format(aString, sizeof(aString), "You have kicked %s from the Administration Team.", pName);
					printf("%s has been kicked from the Administration Team by %s.", pName, RemoveUnderscore(playerid));
					SendClientMessage(targetid, color_lightblue, pString);
					SendClientMessage(playerid, color_lightblue, aString);
					PlayerInfo[targetid][AdminLevel] = alvl;
				} else {
					if(alvl < PlayerInfo[targetid][AdminLevel]){
						pdmo = "demoted";
					} else {
						pdmo = "promoted";
					}
					switch(alvl){
						case 1: atitle = "Server Moderator";
						case 2: atitle = "Junior Administrator";
						case 3: atitle = "General Administrator";
						case 4: atitle = "Senior Administrator";
						case 5: atitle = "Head Administrator";
						case 6: atitle = "Executive Administrator";
					}
					format(pString, sizeof(pString), "You have been %s to %s by %s.", pdmo, atitle, RemoveUnderscore(playerid));
					format(aString, sizeof(aString), "You have %s %s to %s.", pdmo, pName, atitle);
					printf("%s has been %s to %s by %s.", pName, pdmo, atitle, RemoveUnderscore(playerid));
					SendClientMessage(targetid, color_lightblue, pString);
					SendClientMessage(playerid, color_lightblue, aString);
					PlayerInfo[targetid][AdminLevel] = alvl;
				}
			}
		} else {
			return SendClientMessage(playerid, color_gray, "You are not authorized to use this command.");
		}
	return 1;
}

CMD:a(playerid, params[]) {
	if(PlayerInfo[playerid][AdminLevel] > 0){
		if(!isnull(params)){
			new string[128];
			switch(PlayerInfo[playerid][AdminLevel]){
				case 1: format(string, sizeof(string), "Server Moderator %s: %s", RemoveUnderscore(playerid), params);
				case 2: format(string, sizeof(string), "Junior Administrator %s: %s", RemoveUnderscore(playerid), params);
				case 3: format(string, sizeof(string), "General Administrator %s: %s", RemoveUnderscore(playerid), params);
				case 4: format(string, sizeof(string), "Senior Administrator %s: %s", RemoveUnderscore(playerid), params);
				case 5: format(string, sizeof(string), "Head Administrator %s: %s", RemoveUnderscore(playerid), params);
				case 6: format(string, sizeof(string), "Executive Administrator %s: %s", RemoveUnderscore(playerid), params);
			}
			printf("[Admin Chat] %s", string);
			for(new i=0;i<MAX_PLAYERS;i++)
			{
				if(IsPlayerConnected(i))
				{
					if(PlayerInfo[i][AdminLevel] > 0)
					{
						SendClientMessage(i, color_yellow, string);
					}
				}
			}
		} else {
			return SendClientMessage(playerid, color_gray, "USAGE: /a [Message]");
		}
	} else {
		return SendClientMessage(playerid, color_gray, "You are not authorized to use this command.");
	}
	return 1;
}

CMD:ban(playerid, params[]){
	new targetid, reason[64];
	if(PlayerInfo[playerid][AdminLevel] > 0){
		if(sscanf(params, "us[64]", targetid, reason)){
			return SendClientMessage(playerid, color_gray, "Usage: /ban [ID] [Reason]");
		}  else if(!IsPlayerConnected(targetid)){
			return SendClientMessage(playerid, color_gray, "User not online.");
		} else if(PlayerInfo[targetid][AdminLevel] >= PlayerInfo[playerid][AdminLevel]){
			return SendClientMessage(playerid, color_gray, "You can't ban higher rank admins!");
		} else {
			new string[128];
			format(string, sizeof(string), "%s has been banned by %s - Reason: %s", RemoveUnderscore(targetid), RemoveUnderscore(playerid), reason);
			SendClientMessageToAll(color_orange, string);
			printf("%s", string);
			BanEx(targetid, reason);
		}
	} else {
		return SendClientMessage(playerid, color_gray, "You are not authorized to use this command.");
	}
	return 1;
}

CMD:kick(playerid, params[]){
	new targetid, reason[64];
	if(PlayerInfo[playerid][AdminLevel] > 0){
		if(sscanf(params, "us[64]", targetid, reason)){
			return SendClientMessage(playerid, color_gray, "Usage: /kick [ID] [Reason]");
		}  else if(!IsPlayerConnected(targetid)){
			return SendClientMessage(playerid, color_gray, "User not online.");
		} else if(PlayerInfo[targetid][AdminLevel] >= PlayerInfo[playerid][AdminLevel]){
			return SendClientMessage(playerid, color_gray, "You can't kick higher rank admins!");
		} else {
			new string[128];
			format(string, sizeof(string), "%s has been kicked by %s - Reason: %s", RemoveUnderscore(targetid), RemoveUnderscore(playerid), reason);
			SendClientMessageToAll(color_orange, string);
			printf("%s", string);
			Kick(targetid);
		}
	} else {
		return SendClientMessage(playerid, color_gray, "You are not authorized to use this command.");
	}
	return 1;
}


CMD:enter(playerid)
{
	if (GetPlayerState(playerid) == 1){
		// SubUrban1
		if (IsPlayerInRangeOfPoint(playerid,1.5,2779.7612,2453.8887,11.0625)){
			SetPlayerPos(playerid, 203.7814,-50.6649,1001.8047);
			SetPlayerFacingAngle(playerid, 0);
			SetPlayerInterior(playerid, 1);
		}
		// LVBank1
		if (IsPlayerInRangeOfPoint(playerid,1.5,2474.6018,1024.2523,10.8203)){
			SetPlayerPos(playerid, 2304.6868,-16.1464,26.7422);
			SetPlayerFacingAngle(playerid, 270);
		}
		// LVHospital1
		if (IsPlayerInRangeOfPoint(playerid,1.5,1607.3478,1815.2412,10.8203)){
			SetPlayerPos(playerid, 1939.2130,-2102.8940,-19.3109);
			SetPlayerFacingAngle(playerid, 180);
			TogglePlayerControllable(playerid, 0);
			SetTimerEx("unfreezePlayer", 3000, false, "i", playerid);
		}
		// CityHall1
		if (IsPlayerInRangeOfPoint(playerid,1.5,2388.9980,2466.0288,10.8203)){
			SetPlayerPos(playerid, 390.7680,173.8126,1008.3828);
			SetPlayerFacingAngle(playerid, 90);
			SetPlayerInterior(playerid, 3);
		}
        // AmmuNation1
		if (IsPlayerInRangeOfPoint(playerid,1.5,2177.6147,961.0825,10.8203)){
			SetPlayerPos(playerid, 316.3587,-170.2913,999.5938);
			SetPlayerFacingAngle(playerid, 0);
			SetPlayerInterior(playerid, 6);
		}
		// PizzaStack1
		if (IsPlayerInRangeOfPoint(playerid,1.5,2330.6257,2533.6145,10.8203)){
			SetPlayerPos(playerid, 372.3385,-133.5243,1001.4922);
			SetPlayerFacingAngle(playerid, 0);
			SetPlayerInterior(playerid, 5);
		}
		// PizzaStack Office
		if (IsPlayerInRangeOfPoint(playerid,1.5,369.0407,-114.6086,1001.4995)){
			SetPlayerPos(playerid, 369.0139,-113.6160,1001.5059);
			SetPlayerFacingAngle(playerid, 360);
		}
	} else {
		return SendClientMessage(playerid, color_gray, "You need to be walking to enter!");
	}
	return 1;
}


CMD:exit(playerid)
{
	// SubUrban1
	if(IsPlayerInRangeOfPoint(playerid,1.5,203.7814,-50.6649,1001.8047)){
		SetPlayerPos(playerid,2779.7612,2453.8887,11.0625);
		SetPlayerFacingAngle(playerid, 135);
		SetPlayerInterior(playerid, 0);
	}
	// LVBank1
	if(IsPlayerInRangeOfPoint(playerid,1.5,2304.6868,-16.1464,26.7422)){
		SetPlayerPos(playerid,2474.6018,1024.2523,10.8203);
		SetPlayerFacingAngle(playerid, 180);
	}
	// LVHospital1
	if(IsPlayerInRangeOfPoint(playerid,1.5,1939.2130,-2102.8940,-19.3109)){
		SetPlayerPos(playerid,1607.3478,1815.2412,10.8203);
		SetPlayerFacingAngle(playerid, 0);
	}
	// CityHall1
	if(IsPlayerInRangeOfPoint(playerid,1.5,390.7680,173.8126,1008.3828)){
		SetPlayerPos(playerid,2388.9980,2466.0288,10.8203);
		SetPlayerFacingAngle(playerid, 90);
		SetPlayerInterior(playerid, 0);
	}
	// AmmuNation1
	if(IsPlayerInRangeOfPoint(playerid,1.5,316.3587,-170.2913,999.5938)){
		SetPlayerPos(playerid,2177.6147,961.0825,10.8203);
		SetPlayerFacingAngle(playerid, 0);
		SetPlayerInterior(playerid, 0);
	}
	// PizzaStack1
	if(IsPlayerInRangeOfPoint(playerid,1.5,372.3385,-133.5243,1001.4922)){
		SetPlayerPos(playerid,2330.6257,2533.6145,10.8203);
		SetPlayerFacingAngle(playerid, 180);
		SetPlayerInterior(playerid, 0);
	}
    // PizzaStack Office
	if(IsPlayerInRangeOfPoint(playerid,1.5,369.0139,-113.6160,1001.5059)){
		SetPlayerPos(playerid,369.0407,-114.6086,1001.4995);
		SetPlayerFacingAngle(playerid, 180);
	}
	return 1;
}

CMD:buyclothes(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid,2,203.2413,-43.2615,1001.8047)){
		ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Select Clothes", "Insert the ID of the skin.", "Submit", "Cancel");
  	} else {
		return SendClientMessage(playerid, color_gray, "You are not at the clothes store!");
	}
	return 1;
}

CMD:deposit(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid,2,2308.8225,-13.2543,26.7422)){
		ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Deposit Money", "Insert the amount of money you want to deposit.", "Deposit", "Cancel");
  	} else {
		return SendClientMessage(playerid, color_gray, "You are not at the bank!");
	}
	return 1;
}

CMD:withdraw(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid,2,2308.8225,-13.2543,26.7422)){
		ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, "Withdraw Money", "Insert the amount of money you want to withdraw.", "Withdraw", "Cancel");
  	} else {
		return SendClientMessage(playerid, color_gray, "You are not at the bank!");
	}
	return 1;
}

CMD:balance(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid,2,2308.8225,-13.2543,26.7422)){
		new string[64];
		format(string, sizeof(string), "Your current bank balance is of $%i", PlayerInfo[playerid][Bank]);
		ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "Bank Balance", string, "OK", "OK");
  	} else {
		return SendClientMessage(playerid, color_gray, "You are not at the bank!");
	}
	return 1;
}

CMD:me(playerid, params[]){
	if(PlayerInfo[playerid][Muted] == 1){
		SendClientMessage(playerid, color_gray, "You are muted!");
	} else {
		if(!isnull(params)){
			new string[128];
			format(string, sizeof(string), "* %s %s", RemoveUnderscore(playerid), params);
			NearByMessage(playerid, color_purple, string, 12);
		} else {
			return SendClientMessage(playerid, color_gray, "Usage: /me [Action]");
		}
	}
	return 1;
}

CMD:do(playerid, params[]){
	if(PlayerInfo[playerid][Muted] == 1){
		SendClientMessage(playerid, color_gray, "You are muted!");
	} else {
	if(!isnull(params)){
			new string[128];
			format(string, sizeof(string), "* %s (( %s ))", params, RemoveUnderscore(playerid));
			NearByMessage(playerid, color_purple, string, 12);
		} else {
			return SendClientMessage(playerid, color_gray, "Usage: /do [Action]");
		}
	}
	return 1;
}

CMD:low(playerid, params[]){
	if(PlayerInfo[playerid][Muted] == 1){
		SendClientMessage(playerid, color_gray, "You are muted!");
	} else {
		if(!isnull(params)){
			new string[128];
			format(string, sizeof(string), "%s quietly says: %s", RemoveUnderscore(playerid), params);
			NearByMessage(playerid, color_white, string, 2);
		} else {
			return SendClientMessage(playerid, color_gray, "Usage: /low [Message]");
		}
	}
	return 1;
}

CMD:l(playerid, params[]) {
	return cmd_low(playerid, params);
}

CMD:shout(playerid, params[]){
	if(PlayerInfo[playerid][Muted] == 1){
		SendClientMessage(playerid, color_gray, "You are muted!");
	} else {
		if(!isnull(params)){
			new string[128];
			format(string, sizeof(string), "%s shouts: %s!", RemoveUnderscore(playerid), params);
			NearByMessage(playerid, color_white, string, 20);
		} else {
			return SendClientMessage(playerid, color_gray, "Usage: /shout [Message]");
		}
	}
	return 1;
}

CMD:s(playerid, params[]) {
	return cmd_shout(playerid, params);
}

CMD:b(playerid, params[]){
	if(PlayerInfo[playerid][Muted] == 1){
		SendClientMessage(playerid, color_gray, "You are muted!");
	} else {
		if(!isnull(params)){
			new string[128];
			format(string, sizeof(string), "%s: (( %s ))", RemoveUnderscore(playerid), params);
			NearByMessage(playerid, color_white, string, 12);
		} else {
			return SendClientMessage(playerid, color_gray, "Usage: /b [Message]");
		}
	}
	return 1;
}

CMD:whisper(playerid, params[])
{
	if(PlayerInfo[playerid][Muted] == 1){
		SendClientMessage(playerid, color_gray, "You are muted!");
	} else {
		new targetid, msg[128];
		if(sscanf(params, "us[128]", targetid, msg)){
			return SendClientMessage(playerid, color_gray, "Usage: /w [ID] [Message]");
		}else if(!IsPlayerConnected(targetid)){
				return SendClientMessage(playerid, color_gray, "Player isn't connected!");
		}else if(IsPlayerInRangeOfPlayer(playerid, targetid, 2)){
				new string[128], mString[64];
				format(string, sizeof(string), "%s whispers to %s: %s", RemoveUnderscore(playerid),RemoveUnderscore(targetid), msg);
				SendClientMessage(playerid, color_yellow, string);
				SendClientMessage(targetid, color_yellow, string);
				format(mString, sizeof(mString), "* %s has whispered something to %s.", RemoveUnderscore(playerid), RemoveUnderscore(targetid));
				NearByMessage(playerid, color_purple, string, 12);
			} else {
				return SendClientMessage(playerid, color_gray, "You are not near that player.");
		}
	}
	return 1;
}

CMD:w(playerid, params[]) {
	return cmd_whisper(playerid, params);
}

CMD:stats(playerid)
{
	new fString[64], sString[64];
	format(fString, sizeof(fString), "%s - Level %i | Total Wealth: $%i", RemoveUnderscore(playerid), PlayerInfo[playerid][Level], PlayerInfo[playerid][Money] + PlayerInfo[playerid][Bank]);
	format(sString, sizeof(sString), "Cash: $%i | Bank balance: $%i", PlayerInfo[playerid][Money], PlayerInfo[playerid][Bank]);
	SendClientMessage(playerid, color_green, "______________________________________________________________");
	SendClientMessage(playerid, color_white, fString);
	SendClientMessage(playerid, color_gray, sString);
	SendClientMessage(playerid, color_green, "______________________________________________________________");
	return 1;
}

CMD:jail(playerid, params[]){
	if(PlayerInfo[playerid][AdminLevel] > 0){
		new targetid, jailTime, reason[128];
		if(sscanf(params, "uis[128]", targetid, jailTime, reason)){
			return SendClientMessage(playerid, color_gray, "Usage: /jail [ID] [Minutes] [Reason]");
		} else if(!IsPlayerConnected(targetid)){
			return SendClientMessage(playerid, color_gray, "Player isn't connected!");
		} else if(PlayerInfo[targetid][AdminLevel] >= PlayerInfo[playerid][AdminLevel]){
			return SendClientMessage(playerid, color_gray, "You can't jail higher rank admins!");
		} else if(PlayerInfo[targetid][AdminLevel] == 1 && jailTime > 15){
			return SendClientMessage(playerid, color_gray, "You are not allowed to jail for more than 15 minutes!");
		} else if(jailTime < 1){
			return SendClientMessage(playerid, color_gray, "You need to jail at least 1 minute!");
		} else {
			new string[128];
			format(string, sizeof(string), "%s has been jailed by %s - Reason: %s", RemoveUnderscore(targetid), RemoveUnderscore(playerid), reason);
			SendClientMessageToAll(color_orange, string);
			printf("%s has been jailed for %i minutes by %s - Reason: %s.", RemoveUnderscore(targetid), jailTime, RemoveUnderscore(playerid), reason);
			PlayerInfo[targetid][Jailed] = 1;
			PlayerInfo[targetid][jTime] = (jailTime * 60000);
			jailPlayer(targetid);
		}
	} else {
		return SendClientMessage(playerid, color_gray, "You are not authorized to use this command.");
	}
	return 1;
}

CMD:release(playerid, params[]){
	if(PlayerInfo[playerid][AdminLevel] > 1){
		new targetid, reason[64];
		if(sscanf(params, "us[64]", targetid, reason)){
			return SendClientMessage(playerid, color_gray, "Usage: /release [ID] [Reason]");
		} else if(!IsPlayerConnected(targetid)){
			return SendClientMessage(playerid, color_gray, "Player isn't connected!");
		} else if(PlayerInfo[targetid][Jailed] == 0){
			return SendClientMessage(playerid, color_gray, "Player isn't jailed!");
		} else {
			new string[128];
			format(string, sizeof(string), "%s has been released by %s - Reason: %s", RemoveUnderscore(targetid), RemoveUnderscore(playerid), reason);
			SendClientMessageToAll(color_orange, string);
			printf("%s", string);
			releasePlayer(targetid);
		}
	} else {
		return SendClientMessage(playerid, color_gray, "You are not authorized to use this command.");
	}
	return 1;
}

CMD:mute(playerid, params[]){
	if(PlayerInfo[playerid][AdminLevel] > 1){
		new targetid;
		if(sscanf(params, "u", targetid)){
			return SendClientMessage(playerid, color_gray, "Usage: /mute [ID]");
		} else if(!IsPlayerConnected(targetid)){
			return SendClientMessage(playerid, color_gray, "Player isn't connected!");
		} else if(PlayerInfo[targetid][AdminLevel] > 0){
			return SendClientMessage(playerid, color_gray, "You can't mute other admins!");
		} else {
			new pString[128], aString[128];
			if(PlayerInfo[targetid][Muted] == 1){
				format(pString, sizeof(pString), "You have been unmuted by %s.", RemoveUnderscore(playerid));
				format(aString, sizeof(aString), "You have unmuted %s.", RemoveUnderscore(targetid));
				SendClientMessage(targetid, color_red, pString);
				SendClientMessage(playerid, color_red, aString);
				printf("%s has been unmuted by %s.", RemoveUnderscore(targetid), RemoveUnderscore(playerid));
				PlayerInfo[targetid][Muted] = 0;
			} else if(PlayerInfo[targetid][Muted] == 0){
				format(pString, sizeof(pString), "You have been muted by %s.", RemoveUnderscore(playerid));
				format(aString, sizeof(aString), "You have muted %s.", RemoveUnderscore(targetid));
				SendClientMessage(targetid, color_red, pString);
				SendClientMessage(playerid, color_red, aString);
				printf("%s has been muted by %s.", RemoveUnderscore(targetid), RemoveUnderscore(playerid));
				PlayerInfo[targetid][Muted] = 1;
			}
		}
	} else {
		return SendClientMessage(playerid, color_gray, "You are not authorized to use this command.");
	}
	return 1;
}

CMD:timeleft(playerid){
	if(PlayerInfo[playerid][Jailed] == 1){
		new string[32];
		format(string, sizeof(string), "~g~Time left:~n~~w~%i seconds.", floatround(PlayerInfo[playerid][jTime] / 1000, floatround_round));
		GameTextForPlayer(playerid, string, 6000, 1);
	} else {
		return SendClientMessage(playerid, color_gray, "You are not jailed!");
	}
	return 1;
}

CMD:suicide(playerid){
	new vehicle = GetPlayerState(playerid);
	if(PlayerInfo[playerid][Dead] == 1 || PlayerInfo[playerid][Jailed] == 1 || vehicle == 2 || vehicle == 3){
	    return SendClientMessage(playerid, color_gray, "You can't do this right now!");
	} else {
		SetPlayerHealth(playerid, 0.0);
 	}
	return 1;
}

CMD:getlicense(playerid){
	if(IsPlayerInRangeOfPoint(playerid, 2, 361.8299,173.5219,1008.3828)){
		ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Select the license you need to acquire.", "Driver License ($100)\nFederal Firearms License ($200)", "Acquire", "Cancel");
    } else {
		return SendClientMessage(playerid, color_gray, "You are not near the license processing module at the City Hall!");
	}
	return 1;
}

CMD:licenses(playerid){
	new string[64], arms[48], driver[48], acqA[13], acqD[13];
	switch(PlayerInfo[playerid][ArmsLicense]){
		case 1: acqA = "Acquired";
		default: acqA = "Not Acquired";
	}
	switch(PlayerInfo[playerid][DriverLicense]){
		case 1: acqD = "Acquired";
		default: acqD = "Not Acquired";
	}
	format(arms, sizeof(arms), "Federal Firearms License: %s.", acqA);
	format(driver, sizeof(driver), "Driver License: %s.", acqD);
	SendClientMessage(playerid, color_blue, "_______________ {FFFFFF}Your Licenses{0000FF} _______________");
	SendClientMessage(playerid, color_white, arms);
	SendClientMessage(playerid, color_white, driver);
	SendClientMessage(playerid, color_blue, "_____________________________________________");
	format(string, sizeof(string), "* %s reaches inside his pocket, grabs his wallet, and glances at his licenses.", RemoveUnderscore(playerid));
	NearByMessage(playerid, color_purple, string, 12);
	return 1;
}

CMD:showlicenses(playerid, params[]){
	new string[64], arms[48], driver[48], acqA[13], acqD[13], targetid, licenses[128];
	if(sscanf(params, "u", targetid)){
	    return SendClientMessage(playerid, color_gray, "Usage: /showlicenses [ID]");
    } else if(!IsPlayerConnected(targetid)){
		return SendClientMessage(playerid, color_gray, "Player isn't connected!");
    } else if(IsPlayerInRangeOfPlayer(playerid, targetid, 2)){
		switch(PlayerInfo[playerid][ArmsLicense]){
			case 1: acqA = "Acquired";
			default: acqA = "Not Acquired";
		}
		switch(PlayerInfo[playerid][DriverLicense]){
			case 1: acqD = "Acquired";
			default: acqD = "Not Acquired";
		}
		format(arms, sizeof(arms), "Federal Firearms License: %s.", acqA);
		format(driver, sizeof(driver), "Driver License: %s.", acqD);
		format(licenses, sizeof(licenses), "_____________________ %s's Licenses _____________________", RemoveUnderscore(playerid));
		SendClientMessage(targetid, color_blue, licenses);
		SendClientMessage(targetid, color_white, arms);
		SendClientMessage(targetid, color_white, driver);
		SendClientMessage(targetid, color_blue, "_____________________________________________");
		format(string, sizeof(string), "* %s has shown %s his licenses.", RemoveUnderscore(playerid), RemoveUnderscore(targetid));
		NearByMessage(playerid, color_purple, string, 12);
	} else {
	    return SendClientMessage(playerid, color_gray, "You are not near that player!");
	}
	return 1;
}

CMD:buyweapon(playerid){
    if(PlayerInfo[playerid][ArmsLicense] == 0){
	    return SendClientMessage(playerid, color_gray, "You don't have an arms license yet, get one at City Hall!");
	}else if(IsPlayerInRangeOfPoint(playerid, 2, 312.5579,-166.1412,999.6010)){
		ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Select the weapon you want to buy.", "M1911 ($300)\nRemington 870 ($450)\nSpringfield M1903 ($600)\nAmmo", "Buy", "Cancel");
	} else {
		return SendClientMessage(playerid, color_gray, "You are not inside AmmuNation!");
	}
	return 1;
}

CMD:dropweapon(playerid){
	if(PlayerInfo[playerid][Weapon] > 0){
		new string[64];
		PlayerInfo[playerid][Weapon] = 0;
		PlayerInfo[playerid][Ammo] = 0;
		ResetPlayerWeapons(playerid);
		format(string, sizeof(string), "* %s has dropped his weapon.", RemoveUnderscore(playerid));
		NearByMessage(playerid, color_purple, string, 12);
	} else {
		return SendClientMessage(playerid, color_gray, "You don't have any weapon!");
	}
	return 1;
}

CMD:giveweapon(playerid, params[]){
	new targetid;
	if(sscanf(params, "u", targetid)){
	    return SendClientMessage(playerid, color_gray, "Usage: /giveweapon [ID]");
    } else if(!IsPlayerConnected(targetid)){
		return SendClientMessage(playerid, color_gray, "Player isn't connected!");
	} else if(PlayerInfo[playerid][Weapon] > 0 && PlayerInfo[targetid][Weapon] == 0 && IsPlayerInRangeOfPlayer(playerid, targetid, 3)){
	    new string[128], ammo = PlayerInfo[playerid][Ammo], weapon = PlayerInfo[playerid][Weapon];
		PlayerInfo[targetid][Ammo] = 0;
		GivePlayerWeaponEx(targetid, weapon, ammo);
		GivePlayerWeapon(targetid, PlayerInfo[targetid][Weapon],PlayerInfo[targetid][Ammo]);
		PlayerInfo[playerid][Weapon] = 0;
		PlayerInfo[playerid][Ammo] = 0;
		ResetPlayerWeapons(playerid);
		format(string, sizeof(string), "* %s has gave his weapon to %s.", RemoveUnderscore(playerid), RemoveUnderscore(targetid));
		NearByMessage(playerid, color_purple, string, 12);
   	} else if(!IsPlayerInRangeOfPlayer(playerid, targetid, 3)){
		return SendClientMessage(playerid, color_gray, "You are not near that player!");
    } else if(PlayerInfo[targetid][Weapon] > 0){
	    return SendClientMessage(playerid, color_gray, "That player already has a weapon!");
	} else {
	    return SendClientMessage(playerid, color_gray, "You don't have any weapon!");
	}
	return 1;
}

CMD:duty(playerid){
	if(PlayerInfo[playerid][Job] == 0){
	    return SendClientMessage(playerid, color_gray, "You don't have a job!");
	} else if(PlayerInfo[playerid][Job] == 1 && PlayerInfo[playerid][Duty] == 0 && IsPlayerInRangeOfPoint(playerid, 1.5, 364.7796, -111.9622, 1001.5059)){
		new string[64];
		PlayerInfo[playerid][Duty] = 1;
		SetPlayerSkin(playerid, 155);
		SetPlayerColor(playerid, color_orange);
		SendClientMessage(playerid, color_white, "You are now on duty as a Pizza Boy!");
		format(string, sizeof(string), "* %s clocks in, grabs his uniform - and goes on duty.", RemoveUnderscore(playerid));
		NearByMessage(playerid, color_purple, string, 12);
	} else if(PlayerInfo[playerid][Job] == 1 && PlayerInfo[playerid][Duty] == 1 && IsPlayerInRangeOfPoint(playerid, 1.5, 364.7796, -111.9622, 1001.5059)) {
		new string[128], mString[32], earned = 30 * PlayerInfo[playerid][PizzaDeliveries];
		PlayerInfo[playerid][Duty] = 0;
	    SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
	    SetPlayerColor(playerid, color_white);
	    GivePlayerMoneyEx(playerid, earned);
	    PlayerInfo[playerid][PizzaDeliveries] = 0;
	    PlayerInfo[playerid][Delivered] = 0;
     	DisablePlayerCheckpoint(playerid);
		format(string, sizeof(string), "* %s clocks out, leaves his uniform - and goes off duty.", RemoveUnderscore(playerid));
		NearByMessage(playerid, color_purple, string, 12);
		format(mString, sizeof(mString), "You earned $%i", earned);
		SendClientMessage(playerid, color_white, mString);
	} else if(!IsPlayerInRangeOfPoint(playerid, 1.5, 364.7796, -111.9622, 1001.5059)){
	    return SendClientMessage(playerid, color_gray, "You are not near your Well Stacked Pizza locker!");
	}
	return 1;
}

CMD:deliver(playerid){
	if(PlayerInfo[playerid][Duty] == 1 && PlayerInfo[playerid][Delivered] == 0 && GetVehicleModel(GetPlayerVehicleID(playerid)) == 448){
		DisablePlayerCheckpoint(playerid);
        SetPlayerCheckpoint(playerid, 2330.6257, 2533.6145, 10.8203, 3.0);
    	SendClientMessage(playerid, color_white, "Go to the checkpoint to get the order and address for delivery!");
		PlayerInfo[playerid][Delivered] = 1;
    } else if(PlayerInfo[playerid][Delivered] == 1 || PlayerInfo[playerid][Delivered] == 2 || PlayerInfo[playerid][Delivered] == 3){
	    return SendClientMessage(playerid, color_gray, "You have a pending delivery!");
    } else if(PlayerInfo[playerid][Job] == 0){
	    return SendClientMessage(playerid, color_gray, "You don't have the Pizza Boy job!");
    } else if(PlayerInfo[playerid][Duty] == 0){
    	return SendClientMessage(playerid, color_gray, "You are not on duty! Go to your locker to get on duty!");
	} else if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 448){
        return SendClientMessage(playerid, color_gray, "You are not on a pizza boy bike!");
	}
	return 1;
}

CMD:quitjob(playerid){
	if(PlayerInfo[playerid][Job] == 0){
		return SendClientMessage(playerid, color_gray, "You don't have a job!");
	} else {
	    PlayerInfo[playerid][Job] = 0;
	    PlayerInfo[playerid][Duty] = 0;
	    PlayerInfo[playerid][PizzaDeliveries] = 0;
	    PlayerInfo[playerid][Delivered] = 0;
	    DestroyObject(GetPVarInt(playerid, "pizzabox"));
	    DisablePlayerCheckpoint(playerid);
	    SetPlayerColor(playerid, color_white);
	    SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
	    SendClientMessage(playerid, color_white, "You have quitted your job!");
	}
	return 1;
}

CMD:apply(playerid){
    if(!IsPlayerInRangeOfPoint(playerid, 1.5, 368.2992,-111.2176,1002.2758)){
	    return SendClientMessage(playerid, color_gray, "You are not near Well Stacked Pizza office!");
    } else if(PlayerInfo[playerid][Job] != 0){
	    return SendClientMessage(playerid, color_gray, "You already have a job!");
    } else if(PlayerInfo[playerid][DriverLicense] == 0){
        return SendClientMessage(playerid, color_gray, "You need a driver license to apply for this job!");
    } else {
		ShowPlayerDialog(playerid, 8, DIALOG_STYLE_MSGBOX, "Pizza Boy Job Application", "Are you 18 years old or older?", "Yes", "No");
 	}
	return 1;
}

CMD:help(playerid, params[]){
	if(isnull(params)){
		return SendClientMessage(playerid, color_gray, "Usage: /help [Message]");
	} else if(helpChatOff == 1){
		 return SendClientMessage(playerid, color_gray, "Help chat was togged off by an administrator.");
	} else if(PlayerInfo[playerid][hChatOff] == 1){
		return SendClientMessage(playerid, color_gray, "Help chat is togged off! (/toghelp)");
	} else if(PlayerInfo[playerid][helpTime] != 0){
		new msg[64];
		format(msg, sizeof(msg), "Please wait %i seconds to talk again in Help chat.", PlayerInfo[playerid][helpTime]);
		SendClientMessage(playerid, color_gray, msg);
	} else {
		new text[128];
		format(text, sizeof(text), "[Help Chat] %s: %s", RemoveUnderscore(playerid), params);
		printf("%s", text);
		for(new i=0;i<MAX_PLAYERS;i++){
			if(IsPlayerConnected(i)){
				if(PlayerInfo[i][hChatOff] == 0){
					SendClientMessage(i, color_lightblue, text);
					PlayerInfo[playerid][helpTime] = 30;
					helpTimer[playerid] = SetTimer("helpChat", 1000, false);
				}
			}
		}
	}
	return 1;
}

CMD:toghelp(playerid){
    if(PlayerInfo[playerid][hChatOff] == 0){
        PlayerInfo[playerid][hChatOff] = 1;
        return SendClientMessage(playerid, color_white, "You tog off the Help chat!");
	} else {
	    PlayerInfo[playerid][hChatOff] = 0;
        SendClientMessage(playerid, color_white, "You tog on the Help chat!");
	}
	return 1;
}

CMD:toghelpchat(playerid){
	if(PlayerInfo[playerid][AdminLevel] > 2 && helpChatOff == 0){
        helpChatOff = 1;
        SendClientMessageToAll(color_white, "Help chat was togged off by an administrator.");
		printf("%s has togged off the Help Chat.", RemoveUnderscore(playerid));
	} else if(PlayerInfo[playerid][AdminLevel] > 2 && helpChatOff == 1){
		helpChatOff = 0;
		SendClientMessageToAll(color_white, "Help chat was togged on by an administrator.");
		printf("%s has togged on the Help Chat.", RemoveUnderscore(playerid));
	} else {
        return SendClientMessage(playerid, color_gray, "You are not authorized to use this command.");
	}
	return 1;
}

CMD:report(playerid, params[]){
	new targetid, msg[128];
	if(sscanf(params,"us[128]", targetid, msg)){
		return SendClientMessage(playerid, color_gray, "Usage: /report [ID] [Message]");
    } else if(!IsPlayerConnected(targetid)){
		return SendClientMessage(playerid, color_gray, "Player isn't connected!");
	} else if(PlayerInfo[playerid][reportTime] != 0){
		new wait[64];
		format(wait, sizeof(wait), "Please wait %i seconds to report again.", PlayerInfo[playerid][reportTime]);
		SendClientMessage(playerid, color_gray, wait);
	} else {
		new text[128];
		format(text, sizeof(text), "[Report] %s reported %s:  %s", RemoveUnderscore(playerid), RemoveUnderscore(targetid), msg);
		printf("%s", text);
		for(new i=0;i<MAX_PLAYERS;i++){
			if(IsPlayerConnected(i)){
				if(PlayerInfo[i][AdminLevel] > 1){
				    SendClientMessage(playerid, color_yellow, "Your report has been sended to administrators for further review.");
					SendClientMessage(i, color_yellow, text);
					PlayerInfo[playerid][reportTime] = 30;
					PlayerInfo[playerid][reported] = 1;
					reportTimer[playerid] = SetTimer("report", 1000, false);
				}
			}
		}
	}
	return 1;
}

CMD:acceptr(playerid, params[]){
	new targetid;
	if(PlayerInfo[playerid][AdminLevel] < 2){
	    return SendClientMessage(playerid, color_gray, "You are not authorized to use this command.");
	} else if(sscanf(params, "u", targetid)){
		return SendClientMessage(playerid, color_gray, "Usage: /acceptr [ID]");
	} else if(!IsPlayerConnected(targetid)){
		return SendClientMessage(playerid, color_gray, "Player isn't connected!");
	} else if(PlayerInfo[targetid][reported] == 0){
	    return SendClientMessage(playerid, color_gray, "Player hasn't reported anything!");
	} else {
		new Float:x, Float:y, Float:z, msg[128];
		GetPlayerPos(targetid, x, y, z);
		format(msg, sizeof(msg), "Administrator %s has reviewed your report and has accepted it for further review.", RemoveUnderscore(playerid));
		SendClientMessage(targetid, color_white, msg);
		SetPlayerPos(playerid, x, y, z);
		SetPlayerInterior(playerid, GetPlayerInterior(targetid));
		PlayerInfo[targetid][reported] = 0;
	}
	return 1;
}

CMD:trashr(playerid, params[]){
	new targetid;
	if(PlayerInfo[playerid][AdminLevel] < 2){
	    return SendClientMessage(playerid, color_gray, "You are not authorized to use this command.");
	} else if(sscanf(params, "u", targetid)){
		return SendClientMessage(playerid, color_gray, "Usage: /trashr [ID]");
	} else if(!IsPlayerConnected(targetid)){
		return SendClientMessage(playerid, color_gray, "Player isn't connected!");
    } else if(PlayerInfo[targetid][reported] == 0){
	    return SendClientMessage(playerid, color_gray, "Player hasn't reported anything!");
	} else {
		new msg[128];
		format(msg, sizeof(msg), "Administrator %s has trashed your report because it is not a valid report.", RemoveUnderscore(playerid));
		SendClientMessage(targetid, color_white, msg);
	}
	return 1;
}

CMD:buycar(playerid){
	if(IsPlayerInRangeOfPoint(playerid,2,2152.4585,1403.3992,11.1328)){
		ShowPlayerDialog(playerid, 13, DIALOG_STYLE_LIST, "Select the car you want to buy.", "Stafford - $3,500\nWashington - $3,500\nSunrise - $4,000\nElegant - $4,000\nMerit - $4,000\nVincent - $4,500", "Buy", "Cancel");
  	} else {
		return SendClientMessage(playerid, color_gray, "You are not at car buying point!");
	}
	return 1;
}

CMD:park(playerid){
	if(!IsPlayerInAnyVehicle(playerid)){
		return SendClientMessage(playerid, color_gray, "You are not in a vehicle!");
	} else if(!IsPlayerInVehicle(playerid, PlayerInfo[playerid][carID])){
		return SendClientMessage(playerid, color_gray, "You are not in your vehicle!");
	} else if(PlayerInfo[playerid][carModel] == 0){
		return SendClientMessage(playerid, color_gray, "You don't own a vehicle!");
	} else {
		new string[64], Float:vehX, Float:vehY, Float:vehZ, Float:vehA; 
		GetVehiclePos(PlayerInfo[playerid][carID], vehX, vehY, vehZ);
		GetVehicleZAngle(PlayerInfo[playerid][carID], vehA);
		PlayerInfo[playerid][carX] = vehX;
		PlayerInfo[playerid][carY] = vehY;
		PlayerInfo[playerid][carZ] = vehZ;
		PlayerInfo[playerid][carA] = vehA;
		format(string, sizeof(string), "* %s has parked his vehicle.", RemoveUnderscore(playerid));
		NearByMessage(playerid, color_purple, string, 12);
	}
	return 1;
}

CMD:vlock(playerid){
	if(PlayerInfo[playerid][carModel] == 0){
		return SendClientMessage(playerid, color_gray, "You don't own a vehicle!");
	} else if(!IsPlayerInRangeOfVehicle(playerid, PlayerInfo[playerid][carID], 10.0)){
		return SendClientMessage(playerid, color_gray, "You are not near your vehicle!");
	} else {
		new string[64];
		switch(PlayerInfo[playerid][carLocked]){
			case 1:{
				PlayerInfo[playerid][carLocked] = 0;
				format(string, sizeof(string), "* %s has unlocked his vehicle.", RemoveUnderscore(playerid));
				NearByMessage(playerid, color_purple, string, 12);
				for(new i = 0; i < MAX_PLAYERS; i++){
					SetVehicleParamsForPlayer(PlayerInfo[playerid][carID], i, 0, 0);
				}
			}
			default:{
				PlayerInfo[playerid][carLocked] = 1;
				format(string, sizeof(string), "* %s has locked his vehicle.", RemoveUnderscore(playerid));
				NearByMessage(playerid, color_purple, string, 12);
				for(new i = 0; i < MAX_PLAYERS; i++){
					SetVehicleParamsForPlayer(PlayerInfo[playerid][carID], i, 0, 1);
				}
			}
		}
	}
	return 1;
}

CMD:sellcar(playerid, params[]){
	new targetid, price;
	if(sscanf(params, "ui", targetid, price)){
		return SendClientMessage(playerid, color_gray, "Usage: /sellcar [PlayerID] [Price]");
	} else if(PlayerInfo[playerid][carModel] == 0){
		return SendClientMessage(playerid, color_gray, "You don't own a vehicle!");
	} else if(!IsPlayerInRangeOfVehicle(playerid, PlayerInfo[playerid][carID], 10.0)){
		return SendClientMessage(playerid, color_gray, "You are not near your vehicle!");
	} else if(PlayerInfo[targetid][carModel] != 0){
		return SendClientMessage(playerid, color_gray, "The player already owns a vehicle!");
	} else if(playerid == targetid){
		return SendClientMessage(playerid, color_gray, "You can't sell a car to yourself!");
	} else if(!IsPlayerInRangeOfPlayer(playerid, targetid, 3.0)){
		return SendClientMessage(playerid, color_gray, "You're not near that player!");
	} else {
		new pString[128], tString[128];
		PlayerInfo[targetid][carDeal] = playerid;
		PlayerInfo[targetid][carDealPrice] = price;
		PlayerInfo[playerid][carDeal] = targetid;
		format(pString, sizeof(pString), "You have offered %s to buy your %s for $%i.", RemoveUnderscore(targetid), VehicleNames[PlayerInfo[playerid][carModel] - 400], price);
		format(tString, sizeof(tString), "%s has offered you his %s for $%i. Type '/acceptcar' to buy it.", RemoveUnderscore(playerid), VehicleNames[PlayerInfo[playerid][carModel] - 400], price);
		SendClientMessage(playerid, color_lightblue, pString);
		SendClientMessage(targetid, color_lightblue, tString);
	}
	return 1;
}

CMD:acceptcar(playerid){
	new sellerid = PlayerInfo[playerid][carDeal];
	if(PlayerInfo[playerid][carDeal] == -1){
		return SendClientMessage(playerid, color_gray, "No one offered you a car deal!");
	} else if(!IsPlayerInRangeOfPlayer(playerid, PlayerInfo[playerid][carDeal], 3.0)){
		SendClientMessage(playerid, color_gray, "You're not near the player!");
		PlayerInfo[sellerid][carDeal] = 0;
		PlayerInfo[playerid][carDeal] = 0;
		PlayerInfo[playerid][carDealPrice] = 0;
	} else if(PlayerInfo[playerid][carDealPrice] > PlayerInfo[playerid][Money]){
		SendClientMessage(playerid, color_gray, "You don't have enough money!");
		PlayerInfo[sellerid][carDeal] = 0;
		PlayerInfo[playerid][carDeal] = 0;
		PlayerInfo[playerid][carDealPrice] = 0;
	} else {
		new bString[128], sString[128], Float:sCarX, Float:sCarY, Float:sCarZ, Float:sCarA;
		PlayerInfo[playerid][carModel] = PlayerInfo[sellerid][carModel];
		GetVehiclePos(PlayerInfo[sellerid][carID], sCarX, sCarY, sCarZ);
		GetVehicleZAngle(PlayerInfo[sellerid][carID], sCarA);
		PlayerInfo[playerid][carX] = sCarX;
		PlayerInfo[playerid][carY] = sCarY;
		PlayerInfo[playerid][carZ] = sCarZ;
		PlayerInfo[playerid][carA] = sCarA;
		PlayerInfo[playerid][carColor1] = PlayerInfo[sellerid][carColor1];
		PlayerInfo[playerid][carColor2] = PlayerInfo[sellerid][carColor2];
		for(new i = 0; i < 13; i++){
			PlayerInfo[playerid][carMod][i] = PlayerInfo[sellerid][carMod][i];
		}
		PlayerInfo[playerid][carPaintJob] = PlayerInfo[sellerid][carPaintJob];
		PlayerInfo[playerid][carLicensePlate] = PlayerInfo[sellerid][carLicensePlate];
		PlayerInfo[playerid][carLocked] = PlayerInfo[sellerid][carLocked];
		PlayerInfo[playerid][Money] -= PlayerInfo[playerid][carDealPrice];
		PlayerInfo[sellerid][Money] += PlayerInfo[playerid][carDealPrice];
		PlayerInfo[sellerid][carDeal] = 0;
		PlayerInfo[playerid][carDeal] = 0;
		PlayerInfo[sellerid][carModel] = 0;
		PlayerInfo[sellerid][carX] = 0;
		PlayerInfo[sellerid][carY] = 0;
		PlayerInfo[sellerid][carZ] = 0;
		PlayerInfo[sellerid][carA] = 0;
		PlayerInfo[sellerid][carColor1] = 0;
		PlayerInfo[sellerid][carColor2] = 0;
		for(new i = 0; i < 13; i++){
			PlayerInfo[sellerid][carMod][i] = 0;
		}
		PlayerInfo[sellerid][carPaintJob] = 0;
		PlayerInfo[sellerid][carLicensePlate] = 0;
		PlayerInfo[sellerid][carLocked] = 0;
		PlayerInfo[sellerid][carTracking] = 0;
		DestroyVehicle(PlayerInfo[sellerid][carID]);
		CreatePlayerVehicle(playerid);
		format(bString, sizeof(bString), "Congratulations! You have purchased a %s from %s for $%i.", VehicleNames[PlayerInfo[playerid][carModel] - 400], RemoveUnderscore(sellerid), PlayerInfo[playerid][carDealPrice]);
		format(sString, sizeof(sString), "You've succesfully sold your %s to %s for $%i.", VehicleNames[PlayerInfo[playerid][carModel] - 400], RemoveUnderscore(playerid), PlayerInfo[playerid][carDealPrice]);
		PlayerInfo[playerid][carDealPrice] = 0;
		SendClientMessage(playerid, color_white, bString);
		SendClientMessage(sellerid, color_white, sString);
	}
	return 1;
}

CMD:trackcar(playerid){
	if(PlayerInfo[playerid][carModel] == 0){
		return SendClientMessage(playerid, color_gray, "You don't own a vehicle!");
	} else if(PlayerInfo[playerid][carTracking] == 1){
		return SendClientMessage(playerid, color_gray, "You're already tracking your vehicle!");
	} else if(PlayerInfo[playerid][Delivered] != 0){
		return SendClientMessage(playerid, color_gray, "You already have an active checkpoint! Get rid of it first.");
	} else { 
		new string[128], carZone[28], cZo, Float:tCarX, Float:tCarY, Float:tCarZ;
		GetVehiclePos(PlayerInfo[playerid][carID], tCarX, tCarY, tCarZ);
		SetPlayerCheckpoint(playerid, tCarX, tCarY, tCarZ, 10.0);
		cZo = GetVehicle2DZone(PlayerInfo[playerid][carID], carZone, sizeof(carZone));
		format(string, sizeof(string), "Your %s was located at%s. A way-point has been set to it.", VehicleNames[PlayerInfo[playerid][carModel] - 400], cZo);
		SendClientMessage(playerid, color_white, string);
		PlayerInfo[playerid][carTracking] = 1;
	}
	return 1;
}

CMD:cell(playerid){
	if(PlayerInfo[playerid][Faction] != 1){
		return SendClientMessage(playerid, color_gray, "You're not part of the LVPD!");
	} else if(PlayerInfo[playerid][Faction] == 1 && PlayerInfo[playerid][Duty] == 0){
		return SendClientMessage(playerid, color_gray, "You're not in duty!");
	} else {
		if(IsPlayerInRangeOfPoint(playerid, 2.0, 1778.4448, -1567.2291, 1734.9430)){
			switch(cellGates[0][1]){
				case 0:{
					MoveDynamicObject(cellGates[0][0], 1778.52160645, -1566.82812500, 1724.23, 3.0);
					cellGates[0][1] = 1;
				}
				case 1:{
					MoveDynamicObject(cellGates[0][0], 1778.52160645, -1566.82812500, 1735.73, 3.0);
					cellGates[0][1] = 0;
				}
			}
		} if(IsPlayerInRangeOfPoint(playerid, 2.0, 1774.3433,-1567.2299,1734.9430)){
			switch(cellGates[1][1]){
				case 0:{
					MoveDynamicObject(cellGates[1][0], 1774.39318848, -1566.82873535, 1724.23, 3.0);
					cellGates[1][1] = 1;
				}
				case 1:{
					MoveDynamicObject(cellGates[1][0], 1774.39318848, -1566.82873535, 1735.73, 3.0);
					cellGates[1][1] = 0;
				}
			}
		} if(IsPlayerInRangeOfPoint(playerid, 2.0, 1769.9894,-1567.2297,1734.9430)){
			switch(cellGates[2][1]){
				case 0:{
					MoveDynamicObject(cellGates[2][0], 1770.06335449, -1566.82812500, 1724.23, 3.0);
					cellGates[2][1] = 1;
				}
				case 1:{
					MoveDynamicObject(cellGates[2][0], 1770.06335449, -1566.82812500, 1735.73, 3.0);
					cellGates[2][1] = 0;
				}
			}
		} if(IsPlayerInRangeOfPoint(playerid, 2.0, 1765.6829,-1567.2295,1734.9430)){
			switch(cellGates[3][1]){
				case 0:{
					MoveDynamicObject(cellGates[3][0], 1765.75830078, -1566.82812500, 1724.23, 3.0);
					cellGates[3][1] = 1;
				}
				case 1:{
					MoveDynamicObject(cellGates[3][0], 1765.75830078, -1566.82812500, 1735.73, 3.0);
					cellGates[3][1] = 0;
				}
			}
		} if(IsPlayerInRangeOfPoint(playerid, 2.0, 1761.4447,-1567.2290,1734.9430)){
			switch(cellGates[4][1]){
				case 0:{
					MoveDynamicObject(cellGates[4][0], 1761.55371094, -1566.82812500, 1724.23, 3.0);
					cellGates[4][1] = 1;
				}
				case 1:{
					MoveDynamicObject(cellGates[4][0], 1761.55371094, -1566.82812500, 1735.73, 3.0);
					cellGates[4][1] = 0;
				}
			}
		} if(IsPlayerInRangeOfPoint(playerid, 2.0, 1757.2198,-1567.2294,1734.9430)){
			switch(cellGates[5][1]){
				case 0:{
					MoveDynamicObject(cellGates[5][0], 1757.27453613, -1566.82812500, 1724.23, 3.0);
					cellGates[5][1] = 1;
				}
				case 1:{
					MoveDynamicObject(cellGates[5][0], 1757.27453613, -1566.82812500, 1735.73, 3.0);
					cellGates[5][1] = 0;
				}
			}
		} if(IsPlayerInRangeOfPoint(playerid, 2.0, 1757.2905,-1579.5948,1734.9430)){
			switch(cellGates[6][1]){
				case 0:{
					MoveDynamicObject(cellGates[6][0], 1757.24633789, -1579.99633789, 1724.23, 3.0);
					cellGates[6][1] = 1;
				}
				case 1:{
					MoveDynamicObject(cellGates[6][0], 1757.24633789, -1579.99633789, 1735.73, 3.0);
					cellGates[6][1] = 0;
				}
			}
		} if(IsPlayerInRangeOfPoint(playerid, 2.0, 1761.6205,-1579.4596,1734.9430)){
			switch(cellGates[7][1]){
				case 0:{
					MoveDynamicObject(cellGates[7][0], 1761.55395508, -1579.86120605, 1724.23, 3.0);
					cellGates[7][1] = 1;
				}
				case 1:{
					MoveDynamicObject(cellGates[7][0], 1761.55395508, -1579.86120605, 1735.73, 3.0);
					cellGates[7][1] = 0;
				}
			}
		} if(IsPlayerInRangeOfPoint(playerid, 2.0, 1765.7889,-1579.3307,1734.9430)){
			switch(cellGates[8][1]){
				case 0:{
					MoveDynamicObject(cellGates[8][0], 1765.73645020, -1579.73156738, 1724.23, 3.0);
					cellGates[8][1] = 1;
				}
				case 1:{
					MoveDynamicObject(cellGates[8][0], 1765.73645020, -1579.73156738, 1735.73, 3.0);
					cellGates[8][1] = 0;
				}
			}
		} if(IsPlayerInRangeOfPoint(playerid, 2.0, 1770.0499,-1579.1227,1734.9430)){
			switch(cellGates[9][1]){
				case 0:{
					MoveDynamicObject(cellGates[9][0], 1769.99047852, -1579.52392578, 1724.23, 3.0);
					cellGates[9][1] = 1;
				}
				case 1:{
					MoveDynamicObject(cellGates[9][0], 1769.99047852, -1579.52392578, 1735.73, 3.0);
					cellGates[9][1] = 0;
				}
			}
		} if(IsPlayerInRangeOfPoint(playerid, 2.0, 1774.3112,-1579.0126,1734.9430)){
			switch(cellGates[10][1]){
				case 0:{
					MoveDynamicObject(cellGates[10][0], 1774.27429199, -1579.41479492, 1724.23, 3.0);
					cellGates[10][1] = 1;
				}
				case 1:{
					MoveDynamicObject(cellGates[10][0], 1774.27429199, -1579.41479492, 1735.73, 3.0);
					cellGates[10][1] = 0;
				}
			}
		} if(IsPlayerInRangeOfPoint(playerid, 2.0, 1778.4956,-1578.8831,1734.9430)){
			switch(cellGates[11][1]){
				case 0:{
					MoveDynamicObject(cellGates[11][0], 1778.48120117, -1579.28405762, 1724.23, 3.0);
					cellGates[11][1] = 1;
				}
				case 1:{
					MoveDynamicObject(cellGates[11][0], 1778.48120117, -1579.28405762, 1735.73, 3.0);
					cellGates[11][1] = 0;
				}
			}
		}
	}
	return 1;
}